16Fermer18
gon33Le 08/07/2008 à 12:15
[nosmile]Y'a bcp mieux je crois... =D

grinisp "MAIN PROGRAM
:For(L,-1,0:If L:Goto S:End
grinisp "MAIN AGAIN
:For(L,-1,0:If L:Goto S:End
grinisp "BACK IN MAIN
sorrytop
:Lbl S
grinisp "IN SUBROUTINE
:End
grinisp "N.B.

C'est un petit truc qui permet d'éviter d'avoir à préciser ou reprendre l'exécution. (Il n'y a qu'un label)
Et puis on pourrait presque compiler mécaniquement nos programmes comme ça...

Une autre version qui m'a été envoyé par Nitacku y'a longtemps:

grinisp "This is the first line of the program"
:stuff
:Goto A
:Lbl 1 This is the start of sub-program 1
:sub-program 1
:0 this 0 is an important flag. It always goes directly before the extra end.
:End <--this is the extra end
:Lbl A
:1 Let's begin the method of calling sub-program 1
:Repeat Ans
:If Ans
:Goto 1
:1
:End
:stuff the program will reach this point only after running the sub-program listed under Lbl 1

Voilà, après perso je trouve ça assez lourd à compiler, mais c'est le plus rapide, et flexible...

(pour d'autres infos sur le sujet: http://www.ticalc.org/archives/files/fileinfo/145/14542.html)