Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any known issues with PARAMETERS()?
Message
From
30/06/2000 13:23:18
 
 
To
29/06/2000 15:43:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00386643
Message ID:
00387192
Views:
15
John,
FWIW here's whats in the Hackers Guide ...
PARAMETERS(), the FoxPro version, tells you how many parameters were passed in the last function or procedure call. PCOUNT(), supposedly added only for dBASE compatibility and not even listed in the Help index before VFP 5, tells you how many parameters were passed to the routine you're now in. This time, we think dBASE got it right. 

Using PARAMETERS() has always been a tricky thing. You have to be sure to grab the value as soon as you enter the routine and hope that no ON KEY LABEL or other interrupt occurs that could change the value before you get it.

PCOUNT(), on the other hand, gets that part right every time. We recommend you stick with PCOUNT() and avoid PARAMETERS().
Sounds like PARAMETERS() has its problems. I have always used PCOUNT() for no special reason. Maybe my brain always thought PCOUNT() was less chars to type :)



>I haven't installed SP4 yet. Waiting for the CD. Hmmm...I reported it to Garrett...lessee.
>
>>>OK, here's the really, really odd thing. If I instance the DLL from VB, it works. From VFP, it doesn't. Oh well, switched over to PCOUNT() and it works everywhere then, so I guess I'll just fuggedaboudit.
>>
>>Installed SP4 yet? I've got it installed used the following, and after registering it, seems to work fine with VFP
DEFINE CLASS Foo AS CUSTOM OLEPUBLIC
>>  cResult = ""
>>
>>  PROCEDURE FooMethod(cFoo)
>>
>>    IF PARAMETERS() < 1
>>      This.cResult = "No Parameters passed"
>>    ELSE
>>      This.cResult = "Parameters passed - " + TRANSFORM(PCOUNT())
>>    ENDIF
>>  ENDPROC
>>ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform