Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PARAMETERS() bug?
Message
From
11/11/2002 07:15:37
 
 
To
11/11/2002 06:05:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00720910
Message ID:
00720921
Views:
35
So I should define 5 parameters in LPARAMETERS so I could then go to line IF and see if there is a too much parameters and deal with that 'error' on my own?


>Hi Boban
>
>This is not a bug because your calling program is passing, for instance, 5 parameters but your UDF only has LPARAMETERS receiving statement for 4 which is causing the error to occur. From the VFP help "There must be at least as many parameters in the LPARAMETERS statement as in the DO ... WITH statement. "
>
>You can allocate up to a maximum of 27 parameters to cater for more parameters than 4.
>
>Jos
>
>
>>I have put PARAMETERS() below the LPARAMETERS to see how much parameters have been passed to my UDF.
>>I have put to see if there was a too low or too many parameters passed.
>>
>>It goes something like this.
>>
>>
>>
>>FUNCTION myUDF()
>>     LPARAMETERS para1, para2, para3, para4
>>          IF PARA() < 2 OR PARA() > 4
>>              RETURN .F.
>>          ENDIF
>>and rest....
>>
>>
>>
>>
>>Now, if there are less parameters passed it returns .F., everything is OK.
>>
>>But, if there are more parameters passed (in this case more than 4), it displays error before program reached to the line where is IF statement, and program is out!!!
>>
>>Why is this happening? Is this a kind of a bug?
>>Is there a way to avoide this?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform