Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters() an Pcount functions
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01355239
Message ID:
01355250
Views:
11
Hi Steven,

Since you're using the PARAMETERS statement as the first line, something you might check is whether the SCH_TSK variable *already exists*. That would mean that PCOUNT() or PARAMETERS() would always return 1 whether it was passed or not (the value of SET UDFPARMS may also affect this issue).

Alternately (and probably more safely), you could use the LPARAMETERS statement instead -- that would create a *locally scoped* parameter, and therefore PCOUNT() would only return 1 if a parameter was *actually* passed into the routine.

Just an idea....HTH

>I'm having a problem with an application I've just created where no matter how many parameters I pass the exe or even if I don't pass one at all the Parameters() and PCOUNT() functions are returning a value of one. I've used this same section of code in dozens of applications and this is the first time I have ever encountered this problem Any help is greatly appreciated.
>
>
>PARAMETERS sch_tsk
>
>IF PARAMETERS() > 0
>      M.TASK_CMD = sch_tsk
>ENDIF
>
>DO FORM ('FRMSCAN')
>READ EVENTS
>
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform