Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter array
Message
From
09/11/2011 11:05:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
OS:
Windows 7
Miscellaneous
Thread ID:
01528475
Message ID:
01528490
Views:
56
Thanks! That will do the trick.

>No parameter array in VFP. The closest you can get
>
>foo('one', 'two', 'three')
>
>FUNCTION foo(luP1, luP2,luP3, luP4, luP5)
>LOCAL lnPcount, lnI
>lnPcount = PCOUNT()
>LOCAL ARRAY laParam[lnPcount] 
>FOR lnI=1 TO lnPcount
>	laParam[lnI] = EVALUATE("luP" + TRANSFORM(lnI))
>ENDFOR
>
>FOR lnI=1 TO lnPcount
>	? laParam[lnI]
>ENDFOR
>
>
>RETURN
>
>
>
>>
>>Is there a parameter array?
>>
>>
>>foo('one', 'two', 'three')
>>
>>return
>>
>>Function foo(dog, cat, hen)
>>
>>? aPara(1)   &&displays 'one'
>>? dog           &&displays 'one'
>>? aPara(2)   &&displays 'two'
>>? aPara(3)   &&displays 'three'
>>
>>
>>return
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform