Author |
Message |
TrAnCeIn4LiFe
|
Posted: Thu Jun 03, 2004 12:54 pm Post subject: hasch.. |
|
|
yah i was wondering if sombody could give me like example of hasch statment ill looking at this one writen dunno but no clue how to use it teacher never thought us |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Paul
|
Posted: Thu Jun 03, 2004 2:34 pm Post subject: (No subject) |
|
|
code: |
put "Press anykey to exit"
loop
if hasch then
exit
end if
end loop
|
|
|
|
|
|
|
Tony
|
Posted: Thu Jun 03, 2004 3:54 pm Post subject: (No subject) |
|
|
you might want to flush the input buffer right after the hasch |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
SuperGenius
|
Posted: Thu Jun 03, 2004 3:56 pm Post subject: (No subject) |
|
|
what do you mean by that tony? |
|
|
|
|
|
Tony
|
Posted: Thu Jun 03, 2004 4:08 pm Post subject: (No subject) |
|
|
i mean use getch to get rid of buffered input, because otherwise the hasch will continue to return true and would skip any next menu
code: |
%bad
put "Press anykey to exit"
loop
if hasch then
exit
end if
end loop
put "don't press anything"
loop
if hasch then
exit
end if
end loop
put "i told you not to press anything"
|
It is often useful to have a flush function run right before any "press any key to continue" message.
code: |
procedure flush
var c : string (1)
loop
exit when not hasch
getch (c)
end loop
end flush
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Paul
|
Posted: Thu Jun 03, 2004 4:20 pm Post subject: (No subject) |
|
|
oh yea, forgot about that... so thats why some of my hasch's haven't been working. |
|
|
|
|
|
TrAnCeIn4LiFe
|
Posted: Thu Jun 03, 2004 5:23 pm Post subject: (No subject) |
|
|
hum, got it but one quick question i'm running the game and it wont exit when i use hasch comand why...? is it cuz of all the input keydowns or ??
|
|
|
|
|
|
SuperGenius
|
Posted: Thu Jun 03, 2004 5:27 pm Post subject: (No subject) |
|
|
i believe that input.keydown works seperate from getch. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Thu Jun 03, 2004 9:22 pm Post subject: (No subject) |
|
|
yes, Input.KeyDown modifies it's chars array. Getch stores input in a buffer |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|