Big Problem

Blitz3D Forums/Blitz3D Beginners Area/Big Problem

Vic Apprentice(Posted 2003) [#1]
I have been working with the demo of Blitz Basic for time, and just recently got BlitzPlus. Here's my problem:

Whenever I do anything that would make the user press a key to end the program, it doesn't work. Here's a quick example:

Print "Hello!!"

While Not KeyHit(1)
Wend
End

I'm running the program in the BlitzPlus IDE and with debug mode on. Is my BlitzPlus copy just messed up?, or am I missing something?


Perturbatio(Posted 2003) [#2]
try keydown instead of keyhit


Vic Apprentice(Posted 2003) [#3]
I just tried it again. It still doesn't work.


Ross C(Posted 2003) [#4]
If that works, there something wrong surely. All my code uses keyhit(1). That's strange. Is it the latest version?


skidracer(Posted 2003) [#5]
For console mode programming (no graphics or windows) use the Input command.


Perturbatio(Posted 2003) [#6]
when you say it doesn't work, do you mean it doesn't quit when you press escape? Or do you mean something else?


Vic Apprentice(Posted 2003) [#7]
I have the newest version. I mean that it doesn't quit when I press the ESC key.


Ross C(Posted 2003) [#8]
Try Skid's suggestion.


Vic Apprentice(Posted 2003) [#9]
Still nothing.


Andy_A(Posted 2003) [#10]
You are in console mode (text only), use the following:

Print "Hello"

Input("Press Enter to Quit")
End


elseano(Posted 2003) [#11]
Hmmm...
seems to work fine for me...
Could it maybe be your computer or something? Try it like this:
while not keyhit(1)
print "hello!"
wend
end


Does that work?


elseano(Posted 2003) [#12]
whoops, double post...


Vic Apprentice(Posted 2003) [#13]
Well, that works, but I would rather use the ESC key.

Is there any way?


Vic Apprentice(Posted 2003) [#14]
I mean, the input thing works.


Vic Apprentice(Posted 2003) [#15]
No, the code you just gave me doesn't work. I tried it before. It just keeps on printing "hello!" over and over again.


skidracer(Posted 2003) [#16]
BlitzPlus console mode is designed to implement standard command line apps where stdin and stdout can be rerouted (to files etc.) hence the removal of support for single keystroke and mouse input.


Vic Apprentice(Posted 2003) [#17]
That's annoying...

By the way, when I set the graphics:

Graphics 800,600

It creates two windows; one with my text, and the other is just blank.


skidracer(Posted 2003) [#18]
The Print and Input commands will create a console window, use the Text command for printing to your graphics screen / window / canvas to avoid a console window being created.


Vic Apprentice(Posted 2003) [#19]
Ahhhhhhhhh...Thanks

Just incase this gets annoying, I'll only ask this one more time...

So there's no way to quit using the ESC key in the console window?


skidracer(Posted 2003) [#20]
There's no way to quit using the ESC key in the console window.


Vic Apprentice(Posted 2003) [#21]
Thanks...

I won't ask anymore questoins now...