Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I put multiple commands on a single line?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00264921
Message ID:
00264933
Vues:
21
You can't place more than one command on one line in VFP.

Is a FOR loop like this would help?
FOR lnI = 1 TO FCount()
   laMyArray[lnI] = Field(lnI)
ENDFOR

>I have the following code:
>LOCAL laMyArray(4)
>laMyArray(1) = "MyTable.MyField 1"
>laMyArray(2) = "MyTable.MyField 2"
>laMyArray(3) = "MyTable.MyField 3"
>laMyArray(4) = "MyTable.MyField 4"
>
>But I would like to do the following code:
>LOCAL laMyArray(4)
>laMyArray(1) = "MyTable.MyField 1" laMyArray(2) = "MyTable.MyField 2"
>laMyArray(3) = "MyTable.MyField 3" laMyArray(4) = "MyTable.MyField 4"
>
>The reason I want to do this is because I have as many as 21 elements in my array and it would be easier to read multiple commands grouped as above rather than scrolling down 21 lines. I would only have to scroll down 11 lines. Will this syntax work or what character is needed to separate the commands?
>
>I thought I read this somewhere, but I don't remember the answer.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform