GLBasic User Manual

Main sections

SETLOOPSUB

SETLOOPSUB "SubName"



Sets the loop SUB rountine, that's continuously called after the main program end.
By default, GLBasic sets it to "GLB_ON_LOOP".

This behaviour slightly breaks with the method used by GLBasic V1-10. It is, however, required for JavaScript ports, because a classic
start:
SHOWSCREEN
GOTO start

would freeze the browser.


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

SETLOOPSUB "MainLoop"

// SUB/FUNCTION or new file end the "main" rountine
SUB MainLoop:
PRINT text$, 0, 100 + SIN(GETTMERALL()/10) * 100
SHOWSCREEN
ENDSUB

See also...