Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing and returning arrays
Message
 
To
15/03/2002 15:18:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00633588
Message ID:
00633624
Views:
23
Jim,

Arrays MUST be passed by reference, this means that the called routine is changing the array that was passed, so ...
DIMENSION laArray(2)
laArray(1) = "abc"
laArray(2) = "def"

MyFunc(@laArray)  && the @ forces "pass by Reference"

?laArray(1) && shows 123
?laArray(2) && showa 456

FUNCTION MyFunc
LPARAMETERS paArray
paArray(1) = "123"
paArray(2) = "456"
RETURN
ENDFUNC
Previous
Reply
Map
View

Click here to load this message in the networking platform