Computer Science Canada

hasch help

Author:  lucky8 [ Sun Mar 01, 2009 3:36 pm ]
Post subject:  hasch help

i need some help with hasch command, i got 3 infinite loop in my program and i used hasch in the first two loop to exit to the next loop but when it enters the next loop it only execute once then it goes to the third loop.

here's what i mean

loop
put "hi"
exit when hasch
end loop

loop
put "bye"
exit when hasch
end loop

it'll loop hi untill i press any key but when it goes to second loop it only put 1 bye then end

Author:  Zren [ Sun Mar 01, 2009 3:54 pm ]
Post subject:  Re: hasch help

The amount of time it takes to exit the loop and draw bye to the screen takes milliseconds. So by the time your checking for a key press the second time, more often then not, you'll still be pressing the key. Either place a delay in between or find a way to register when the key is up and wait until till it is before moving to the bye loop.

Author:  BigBear [ Sun Mar 01, 2009 3:58 pm ]
Post subject:  RE:hasch help

Actually even with a delay(10000) it only puts it once.

Author:  lucky8 [ Sun Mar 01, 2009 4:07 pm ]
Post subject:  Re: hasch help

problem solved Very Happy

put in a getch then it work =]

Author:  The_Bean [ Sun Mar 01, 2009 6:46 pm ]
Post subject:  Re: hasch help

The proper way would be with Input.Flush().


: