Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Static variable
Message
De
03/07/1997 13:14:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00038555
Message ID:
00038562
Vues:
37
>If I want to declare a static variable as an integer, is there a command that don't need to assign value to the variable??
>
>In one of my event:
>
>private t
>
>if t < 10
> laFile[t] = item
> t = t + 1
>endif
>
>I manage the event to fire up everytime it read a command from other program. How can I declare variable "t" so it start with 1 and next time I call the command "t" will be 2.
>
>If I declare "t" as 1, then everytime I call this event variable "t" will always be 1 and overwrite my old data in my array laFile[1].
>
>Any ideas!!

Surely, you can use PUBLIC t, it's better to use app object property, and the last idea: if the only problem is to add one more element to array, you can make it using following lines:
dimension laFile(alen(laFile)+1)
laFile[alen(laFile)]=item
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform