Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PCOUNT() or PARAMETERS()
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00067538
Message ID:
00067557
Views:
24
>Could someone please detail the exact difference between the two functions.
>
>I believe that PARAMETERS cannot be relied on in FPW26 when using ON KEY LABEL.
>
>However can PCOUNT be relied on and why is PCOUNT not documented.
Kevin,

Both PARAMETERS() and PCOUNT() can be fully relied on to tell you what they are desdigned to tell you. There is a subtle but important difference between the two.

PARAMETERS() tells you the number of parameters passed on the last call to any routine.

PCOUNT() tells you the number of parameters passed to the routine that the function appears in.

PCOUNT() is documented, briefly, in the dBASE IV compatibility section of teh help file.

Here's a demonstration of the difference between the two (asume the following program was called with DO Test WITH "ABC");



* Test.prg
PARAMETERS Pram1, parm2

DO Test2 WITH "ABC", "DEF"

? PARAMETERS() && shows 2 because 2 parms were passed to Test2
? PCOUNT() && shows 1 because 1 parm was passed to this routine

PROCEDURE Test2
PARAMETERS Parm1, Parm2
RETURN
Previous
Reply
Map
View

Click here to load this message in the networking platform