Timer+Replacement

Run BASIC has no native timer statement. This slideshow demo by **Brent Thorn** shows how to update the screen on a timed delay. //Published here with Brent's permission//.

code format="vbnet" ' Simple Slideshow Demo ' By Brent D. Thorn, 10/2007 ' Update by Brent 9/2009: Made simpler and more reusable

totalpages = 10 page = 1 playing = 0 [show] cls html " Page ";page;" "

if page > 1 then link #prev, "Previous", [prev] print " "; if not(playing) then link #play, "Play", [play] else link #pause, "Pause", [pause] end if   print " "; if page < totalpages then link #next, "Next", [next]

if playing then Call TimeoutLink 5000, "#next" wait [prev] page = page - 1 goto [show] [next] page = page + 1 goto [show] [pause] playing = 0 goto [show] [play] playing = 1 goto [show]

Sub TimeoutLink msec, linkId$ html "       " End Sub code