Ex:
For(X, 1, 5)
If x=3
Goto A
If x=4
Goto B
if not(max(X={1,2,5
End
lbl 0
Disp"Main
Disp "Ce texte ne fait pas partie du for...
Stop
lbl A
End
lbl B
Disp "Affiché par le For.
EndFor(X, 1, 5)
If x=3
Goto A
If x=4
Goto B
if not(max(X={1,2,5
End
lbl 0
Disp"Main
Disp "Ce texte ne fait pas partie du for...
Stop
lbl A
End
lbl B
Disp "Affiché par le For.
End
gon33 (./60) :
Oui, sauf que je peux mettre tout mon code entre Le For et le label, et je peux mettre plusieurs labels pour un seul for.
). A priori formellement du For au End associé ça fait parti de la boucle, même si certaines partie ne font pas "logiquement" partie de la boucle pour toi (par ce que ce n'est pas exécuté dans le corps de la boucle.. ). bon quand tu mets des 'end' conditionnels, là tu hack bien le truc –ça me rappel l'asm..– et y'a plus trop de définition formelle qui vaille ( disons que tu sors de la grammaire 'normale', même si c'est valide.. )
:Menu("TRUC","DFSDF",A,"SFQSDQF",1,"DGFSEF",EB,"SCSVD",C2,"DGSDG",3D)
:Lbl A
:Lbl B
:Lbl C
:Lbl D
:Lbl E
:Lbl 1
:Lbl EB
:Lbl 2
:Lbl C2
:Lbl 3
:Lbl 3Dgon33 (./73) :
He ben, si on a un label inexistant, avoir une liste de liens (ancres) qui correspondent aux Goto vers le label inexistant.
)
For(Y,1,8) :__For(X,1,16) :____sub(Str1,[A](Y,X)+1,1 :____Output(Y,X,Ans :____If Ans="H":Then :____X→U:Y→V :__End :End :End
:
:While X≠16 :__Output(V,U," " :__0→[A](V,U) :__4→[A](Y,X) :__X→U:Y→V : :__Output(Y,X,"N" : :__0 :__While Ans=0 :____getKey→K :__End :__If Ans=45:Then:0→ᴸLABRO(2):Goto NG:End :If Ans=15:Then:prgmCALTO:Goto GG:End //toute la partie d'ici à... :If Ans=22:Goto QT :If Ans=24 and X>1:Then :If [A](Y,X-1)=0:Then:X-1→X:Else :If [A](Y,X-1)≠1:Then :If [A](Y,X-1)=2 and ([A](Y,X-2)=0 or [A](Y,X-2)=3):Then:X-1→X :If [A](Y,X-1)=0:Then:2→[A](Y,X-1):Output(Y,X-1,"O":End :If [A](Y,X-1)=3:Then:0→[A](Y,X-1):Output(Y,X-1," ":End :End:End:End:End :If Ans=26 and X<16:Then :If [A](Y,X+1)=0:Then:X+1→X:Else :If [A](Y,X+1)≠1:Then :If [A](Y,X+1)=2 and ([A](Y,X+2)=0 or [A](Y,X+2)=3):Then:X+1→X :If [A](Y,X+1)=0:Then:2→[A](Y,X+1):Output(Y,X+1,"O":End :If [A](Y,X+1)=3:Then:0→[A](Y,X+1):Output(Y,X+1," ":End :End:End:End:End :If Ans=25 and Y>1:Then :If [A](Y-1,X)=0:Then:Y-1→Y:Else :If [A](Y-1,X)≠1:Then :If [A](Y-1,X)=2 and ([A](Y-2,X)=0 or [A](Y-2,X)=3):Then:Y-1→Y :If [A](Y-1,X)=0:Then:2→[A](Y-1,X):Output(Y-1,X,"O":End :If [A](Y-1,X)=3:Then:0→[A](Y-1,X):Output(Y-1,X," ":End :End:End:End:End :If Ans=34 and Y<8:Then :If [A](Y+1,X)=0:Then:Y+1→Y:Else :If [A](Y+1,X)≠1:Then :If [A](Y+1,X)=2 and ([A](Y+2,X)=0 or [A](Y+2,X)=3):Then:Y+1→Y :If [A](Y+1,X)=0:Then:2→[A](Y+1,X):Output(Y+1,X,"O":End :If [A](Y+1,X)=3:Then:0→[A](Y+1,X):Output(Y+1,X," ":End :End:End:End:End //...ici devrait être indenté de 1 :End //le While du début fini ici
:If A:Then: Disp 1 : Disp 1:End: Disp 1:If A:Then: Disp 1 : Disp 1:End

)
