GAH!! MY BRAIN HURTS!

Blitz3D Forums/Blitz3D Beginners Area/GAH!! MY BRAIN HURTS!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Instead of making a loop with Repeat..Until, you could also use Repeat..Forever. Then you can use the Exit command to end it. I find that easier, it means you can say something like
If <thisandthis> Then Exit
anywhere in the loop.

question$ = "please tell me about your hobbies"

Repeat

   Print question$

   Color 0, 255, 0
   answer$ = Input ("answer>")
   Color 255, 255, 255
   If answer$ = "" Then Exit

   t = t + 1
   If t Mod 2 = 0 Then 
      question$ = "that is so interesting"
   Else
      question$ = "please tell me more"
   End If

Forever

Print "Hey! .. that's not an answer!"
Delay 2500

End

If the loop is placed inside a function, you can also break the loop (and the Function at the same time) with the Return command.