Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters
Message
 
 
To
10/03/2002 12:13:53
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00630710
Message ID:
00630737
Views:
20
This message has been marked as the solution to the initial question of the thread.
>>>>>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
*!* Framework method mRunClass:
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform