Quote: "Think variables, think lots of variables, think more code, think alot more code"
Not that much more code. Actually, less code than he has.
Here. Same basic result, only this is much more flexible and easier to use. And, unlike yours, this doesn't hault the program while it outputs the entire message.
start = timer()
repeat
cls
if teletype(10,10,"Hello World! This sentence should output at 1 character ever 1/10 second.",start,100) = 0 : endif
if teletype(10,20,"Hello again! This will output at 1 character ever 1/2 second.",start,500) = 0 : endif
until spacekey()=1
rem positions text text$ at (X,Y)
rem startTime should be the current time when you FIRST call the function
rem delay is how quickly the text types out (lower = faster)
rem returns 1 when whole string has finally been outputted
function teletype(x,y,text$, startTime, delay)
pos = (timer() - startTime) / delay
text x,y,left$(text$,pos)
if pos >= len(text$) then exitfunction 1
endfunction 0
PETA - People for the Eating of Tasty Animals
