07-29-2021, 07:53 PM
I am finding that the WAIT command on G1 is problematic with the latest 2021 firmware, reproduced on multiple calculators. No problems on G2 or emulators.
Here's an example program, what it should do is clear the screen, then instruct user to press a key on the keyboard. Once a key is pressed, the key code is displayed for half a second and then screen is cleared again while waiting for next key press. On the G1, the WAIT(-1) is not working properly. It returns -1 immediately on subsequent calls (after the first successful run).
Should be easy to reproduce. This breaks every UI routine that relies on WAIT(-1). Anyone else found this and either have a workaround or has reported it?
Here's an example program, what it should do is clear the screen, then instruct user to press a key on the keyboard. Once a key is pressed, the key code is displayed for half a second and then screen is cleared again while waiting for next key press. On the G1, the WAIT(-1) is not working properly. It returns -1 immediately on subsequent calls (after the first successful run).
Should be easy to reproduce. This breaks every UI routine that relies on WAIT(-1). Anyone else found this and either have a workaround or has reported it?
Code:
#pragma mode( separator(.,;) integer(h32) )
EXPORT TEST()
BEGIN
LOCAL m:=0;
RECT_P();
TEXTOUT_P("Press a key, ENTER to exit",G0,0,0);
REPEAT
RECT_P(G0,0,50,200,70);
REPEAT
m:=WAIT(-1);
UNTIL TYPE(m)==0;
TEXTOUT_P("Key " + STRING(m) + " was pressed",G0,0,50);
WAIT(0.5);
UNTIL m==30;
END;