Posted: Tue Nov 20, 2001 5:47 am
Restored from previous forum. Originally posted by cfriedel.
Having some trouble with a program I am trying to write. For some reason, this procedure will not keep reading from the data. Instead it just types the first line ("This is") over and over. The code is listed below. Can somebody please tell me why this is happening. Thanks for all the help. Sorry if I sound frustrated.
Cliff
Procedure missionpage()
LoadSound(0,"Sounds\typewriter.wav")
ClearScreen(64,64,64)
FlipBuffers()
ClearScreen(64,64,64)
Restore DAT_MissionText
For y = 0 To 3
z = 1
Read text$
While z <= Len(text$)
StartDrawing(ScreenOutput())
DrawingMode(1)
DrawingFont(font1)
FrontColour(255,255,255)
Locate((z*8)-8,y*12)
DrawText(Mid(text$,z,1))
StopDrawing()
FlipBuffers()
StartDrawing(ScreenOutput())
DrawingMode(1)
DrawingFont(font1)
FrontColour(255,255,255)
Locate((z*8)-8,y*12)
DrawText(Mid(text$,z,1))
StopDrawing()
FlipBuffers()
PlaySound(0)
Delay(100)
z = z + 1
Wend
Next
Delay(2000)
FreeSound(0)
ProcedureReturn 0
EndProcedure
DataSection
DAT_MissionText:
Data$ "This is"
Data$ "a test"
Data$ "to write text"
Data$ "to the graphics screen"
EndDataSection
Having some trouble with a program I am trying to write. For some reason, this procedure will not keep reading from the data. Instead it just types the first line ("This is") over and over. The code is listed below. Can somebody please tell me why this is happening. Thanks for all the help. Sorry if I sound frustrated.
Cliff
Procedure missionpage()
LoadSound(0,"Sounds\typewriter.wav")
ClearScreen(64,64,64)
FlipBuffers()
ClearScreen(64,64,64)
Restore DAT_MissionText
For y = 0 To 3
z = 1
Read text$
While z <= Len(text$)
StartDrawing(ScreenOutput())
DrawingMode(1)
DrawingFont(font1)
FrontColour(255,255,255)
Locate((z*8)-8,y*12)
DrawText(Mid(text$,z,1))
StopDrawing()
FlipBuffers()
StartDrawing(ScreenOutput())
DrawingMode(1)
DrawingFont(font1)
FrontColour(255,255,255)
Locate((z*8)-8,y*12)
DrawText(Mid(text$,z,1))
StopDrawing()
FlipBuffers()
PlaySound(0)
Delay(100)
z = z + 1
Wend
Next
Delay(2000)
FreeSound(0)
ProcedureReturn 0
EndProcedure
DataSection
DAT_MissionText:
Data$ "This is"
Data$ "a test"
Data$ "to write text"
Data$ "to the graphics screen"
EndDataSection