GLBasic Benutzerhandbuch

Main sections

SETLOOPSUB

SETLOOPSUB "SubName"



Setzt die loop-SUB Rountine, die nach dem Beenden des Hauptprogrammes fortwährend ausgeführt wird.
Standardmäßig setzt GLBasic die SUB "GLB_ON_LOOP" fest.

Dieses Verhalten bricht etwas mit der Methodik der GLBasic Versionen 1-10. Jedoch ist es für JavaScript zwingend erforderlich, da ein klassisches
start:
SHOWSCREEN
GOTO start

den Browser einfrieren würde.


GLOBAL text$  = "Hello World"
// init ...

SETLOOPSUB "MainLoop"

// SUB/FUNCTION oder neue Datei beendet "Hauptprogramm"-Routine
SUB MainLoop:
PRINT text$, 0, 100 + SIN(GETTMERALL()/10) * 100
SHOWSCREEN
ENDSUB

See also...