Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declare array as Local?
Message
 
 
To
29/11/2001 00:49:04
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00587251
Message ID:
00587420
Views:
27
>>>The docs say when you declare an array (for example: DIMENSION laMyArray[1]), it is a private array. Is there a way to declare an array so it will be local, not private?
>>
LOCAL myarray[2,3]
>>* or
>>LOCAL ARRAY myarray[2,3]
>>
>VFP7 supports only the first syntax. Because of the added clauses in the Local and other declarations, the variables must be separated by commas, and ARRAY was somehow left out from the list of clauses, so the compiler complains (doesn't this rhyme?) about a missing comma after the Array keyword, reporting a syntax error.
>
>So, anyone who declares arrays, just better drop the ARRAY keyword, or you'll have to remove it soon.

VFP 7 supports both formats. In the second case 'ARRAY' is an optional clause of LOCAL command.
* Correct syntax
LOCAL ARRAY myarray1[2,3], myarray2[7]
* Works in VFP 6, syntax error in VFP 7
LOCAL ARRAY myarray1[2,3], ARRAY myarray2[7]
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform