Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optional number of parameters and protected procedure
Message
From
04/01/2007 14:57:52
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
04/01/2007 14:55:17
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01182425
Message ID:
01182483
Views:
47
>>>>>>>>Hi everybody,
>>>>>>>>
>>>>>>>>I have a method in the class with optional number of parameters which calls a protected procedure of the same class. I'm passing parameters as is from one procedure to another. I guess the only way to know from this protected procedure how many parameters did I pass originally is to actually pass the number of parameters as a parameter.
>>>>>>>>
>>>>>>>>Do you see any other way here?
>>>>>>>>
>>>>>>>>Thanks in advance.
>>>>>>>
>>>>>>>What about PARAMETERS()?
>>>>>>>Though I would always pass an object.
>>>>>>
>>>>>>I don't see how parameters can help me here. Anyway, this particular problem is solved, though may be not the best way.
>>>>>
>>>>>It returns number of parameters.
>>>>
>>>>Help says pcount may be preferable in "most programming situations" :)
>>>
>>>I would add "most forgotten programming situations" :)
>>>If number of 'parameters' is more than one- use object, it is preferable.
>>
>>Problem is there is too much existing code around to allow me to forget techniques much as I wish I could.
>
>Let me use your reply as a spring one more time, if you don't mind :)
>Uneven number of parameters indicates incomplete design, and should be avoided. All procedure calls should be done in uniformed way.
>Do you like it?

In an ideal world, where I'm writing new code, I do indeed use parameter objects, so yes, I like it, but I can't always use it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform