Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing param list to function but have it arrive as array
Message
From
19/06/2002 06:51:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Passing param list to function but have it arrive as array
Miscellaneous
Thread ID:
00670055
Message ID:
00670055
Views:
58
I want to pass a series of parameters to a function but have them arrive in the function as an array.

So far there are 2 ways I can think of doing this but I am hoping there is a more obvious way that I am missing.

eg
? myfunc('apple','orange','pear')


func myfunc
lparam myarray  && somehow this needs to get populated from the param list
? myarray(1)
? myarray(2)
? myarray(3)
return
Here are the ways I am considering using

1. Create the array first and send it by reference :( not pretty

2. send a single string myfunc('apple,orange,pear') and then parse the string into an array.

this is a great little function for parsing a comma deliminated string into an array
* nRows = ALINES(myarray, STRTRAN(cTest,",",CHR(13)))


Can someone put my mind at rest, whats the obvious thing I am missing?
Next
Reply
Map
View

Click here to load this message in the networking platform