Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arrays
Message
From
13/06/2002 19:12:00
 
 
To
13/06/2002 16:44:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Arrays
Miscellaneous
Thread ID:
00668248
Message ID:
00668299
Views:
18
Sergey is correct, as always. :)

But for character data, we should mention that there is another option in VFP7. You can use the ALINES function, with a parsechar, to fill your array:
ALINES(_array, "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",.f., ",")
Using ALINES is slightly slower, at runtime, than assigning each element of the array on a separate line of code, but it's not enough to worry about unless you're doing it thousands of times in a loop.

You could also use this method for numeric data types, but you'd have to put them in as character data first, and then loop through with VAL function to convert them to numeric. That wouldn't be the most efficient method at runtime, but it's quick and easy to program. :)

-Tom


(This post is provided "AS-IS" with no warranties, and confers no rights.)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform