Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter scoping behavior
Message
From
24/10/2005 12:41:04
 
 
To
22/10/2005 06:16:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01061120
Message ID:
01061626
Views:
14
>>If you use SET UDFPARAMS TO value (the default), the print is 2 & 1. Best to leave that at it's default and adjust your call instead.
>>
>>* assumes SET UDFPARMS To value
>>
>>SET UDFPARMS TO value
>>
>>x = 1
>>DO myfunc WITH x
>>? x   && prints 2
>>x = 1
>>DO myfunc WITH (x)
>>? x   && prints 1
>>
>>x = 1
>>myfunc(x)
>>? x   && prints 1
>>x = 1
>>myfunc(x)
>>? x   && prints 2
>>
>>
>>FUNCTION myfunc
>>PARAMETERS zz
>>zz = zz + 1
>>
>>
>>
>>Hope I haven't confused you on this.
>
>I hope u dont confuse me :)
>
>u mean, i think :
>
>x = 1
>myfunc(x)
>? x   && prints 1
>x = 1
>myfunc(@x)
>? x   && prints 2
>
Yes, that would be true with the default SET UDFPARMS setting. Changing that setting can cause quite unexpected failures in code that's not expecting the change.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform