Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local array won't work
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00487664
Message ID:
00487775
Vues:
9
>>>>doesn't the "LOCAL ARRAY" definition do the same as "DIMENSION"?
>>>
>>>
>>>DIMENSION creates a PRIVATE array.
>>
>>Nope, not always. Consider the following:
* MyPrg1.prg
>>LOCAL a_anyarray
>>DIMENSION a_anyarray[1]
>>a_anyarray = "Hi there!"
>>DO MyPrg2
>>RETURN
>>
>>* MyPrg2.prg
>>? a_anyarray[1] && Generates "File a_anyarray.prg does not exist" error.
>>RETURN
However, take out the LOCAL statement and it is private because its scope hasn't been specified.
>
>
>Right...that's what I was saying.

I just wanted to clarify the point that DIMENSION, in and of itself, doesn't affect the scope of the variable. It seemed to me that could be derived from your post.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform