Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declare array as Local?
Message
 
 
À
29/11/2001 00:49:04
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00587251
Message ID:
00587420
Vues:
29
>>>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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform