put the chunks of code into separate defs and call them in a while loop. WHILE 1 userDefinedFunction1 userDefinedFunction2 VSYNC WEND