>>>>>Is there a way to programmatically extract parameters comming into a method? PCOUNT() gives us a number of parameters but what about a string of parameters?
>>>>>
>>>>>Thanks, Mark
>>>>
>>>>Mark,
>>>>
>>>>I don't think I understand what you are asking for, can't you simply look at the values in the parameter vars? You must declare the parameters in the method that gets them.
>>>
>>>Here is a sample:
>>>I have a framework method that runs all my classes:
>>>*!* Framework method mRunClass:
>>>LPARAMETERS tlClassName, tcLibName
>>>....
>>>This.poForm = NEWOBJECT(tlClassName, tcLibName)
>>>I'd like to send to mRunClass parameters for NEWOBJECT to send to INIT of tlClassName. I'd like to build NEWOBJECT programmatically to include these parameters and then use EXECSCRIPT() to execute that command.
>>>
>>
>>Hi Mark,
>>
>>Instead of passing multiple parameters you can pass one parameter object. The properties of this parameter object would hold data you want to pass in and out of your class.
>
>
>Of course, but I am calling my forms from a menu. Didn't like to make things too hard. Will probably use parm object.
>Thanks
>Mark
In this case you can use an array parameter
LPARAMETERS tlClassName, tcLibName, tuPar1, tuPar2, ... tuPar10
LOCAL laParam[1], lnParCount
lnParCount = PCOUNT()-2
IF lnParCount > 0
DIMENSION laParam[lnParCount]
FOR i=1 TO lnParCount
laParam[lnParCount] = EVAL( "tuPar") + Transform(i))
ENDFOR
This.poForm = NEWOBJECT(tlClassName, tcLibName, @laParam )
ELSE
This.poForm = NEWOBJECT(tlClassName, tcLibName )
ENDIF
--sb--