CPCWiki forum

General Category => Programming => Topic started by: daddyd on 21:16, 16 September 13

Title: basic sleep
Post by: daddyd on 21:16, 16 September 13
it's been ages since i used basic on the cpc, just tried it again to make something simple to show to kids how easy it is/was.
can't remember how to do a 'sleep' in basic, for example in a loop changing the color of the border and waiting 2 seconds between each color change.
i know it can be done because i did it waaaay back in the 80ties :) i'm starting to think i just used an empty for-loop or something.

anybody?
Title: Re: basic sleep
Post by: andycadley on 22:57, 16 September 13
Oddly Locomotive Basic didn't have a PAUSE command like other versions of Basic, but you could do roughly the same with:

t = TIME: WHILE TIME < t + (300 * 2):WEND

adjusting 2 for the number of seconds you wanted to wait for.
Title: Re: basic sleep
Post by: ralferoo on 22:59, 16 September 13
You could do something like:
for i=1 to 50*2:call &bd19:next
for a 2 second pause.
Title: Re: basic sleep
Post by: Sykobee (Briggsy) on 13:51, 17 September 13
could you use EVERY?


EVERY 600 GOSUB #(routine to change colour)
Powered by SMFPacks Menu Editor Mod