
-----------------------------------
TrAnCeIn4LiFe
Thu Jun 03, 2004 12:54 pm

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 :(

-----------------------------------
Paul
Thu Jun 03, 2004 2:34 pm


-----------------------------------

put "Press anykey to exit"
loop
if hasch then 
exit
end if
end loop


-----------------------------------
Tony
Thu Jun 03, 2004 3:54 pm


-----------------------------------
you might want to flush the input buffer right after the hasch

-----------------------------------
SuperGenius
Thu Jun 03, 2004 3:56 pm


-----------------------------------
what do you mean by that tony?

-----------------------------------
Tony
Thu Jun 03, 2004 4:08 pm


-----------------------------------
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

%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.


procedure flush
    var c : string (1)
    loop
        exit when not hasch
        getch (c)
    end loop
end flush



-----------------------------------
Paul
Thu Jun 03, 2004 4:20 pm


-----------------------------------
oh yea, forgot about that... so thats why some of my hasch's haven't been working.

-----------------------------------
TrAnCeIn4LiFe
Thu Jun 03, 2004 5:23 pm


-----------------------------------
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
Thu Jun 03, 2004 5:27 pm


-----------------------------------
i believe that input.keydown works seperate from getch.

-----------------------------------
Tony
Thu Jun 03, 2004 9:22 pm


-----------------------------------
yes, Input.KeyDown modifies it's chars array. Getch stores input in a buffer
