I'm not sure it really belongs on the object class, and you can actually do this already with the methods that were just added to the array class in 3.2.0. 

    if \opts~hasItem(myvalue) then raise 93.914 ...


On 7/18/07, David Ashley <dashley@us.ibm.com> wrote:

All -

I have been working on a new Sockets class and I came across a method I really needed to add to my class. I believe it is useful enough that we should consider adding it to the Object class as a class method.

I was always needing to check the value of an argument in a method against an array of valid values. Something like

opts = .array~of('VALUE1', 'VALUE2', 'VALUE3')
if self~checkValue(myvalue, opts) then raise 93.914 ...

The method looks like this

::method checkValue
use strict arg checkval, checkarray
do z over checkarray
if checkval = z then return .false
return .true

I thought this was so obvious that it should be available to all classes in ooRexx.

Your opinions on this would be valuable. I am not tied to the method name I have chosen. Another name would be just fine with me.

W. David Ashley
IBM Systems and Technology Group Lab Services
Open Object Rexx Team
Mobile Phone: 512-289-7506

This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Oorexx-devel mailing list