Post Reply 
Controlling program exit
11-13-2020, 05:03 PM
Post: #1
Controlling program exit
Hi all,
For a new program I created a REPEAT loop with an exit option in it, see the box below. The intention is to end the program when the backspace key is pressed. But in practice, I have to press this key twice to achieve this. And that is not the intention. I have also tried a WHILE loop, but it gives the same result. How can I improve this? I also wonder if the touch screen portion is properly processed. Any comments or improvements to this program are welcome. Sincerely, Karel.

Code:

....
LOCAL input,cx,cy;
REPEAT
 input:=WAIT(-1);  //Wait for input.
 CASE
  IF TYPE(input)==0 THEN  // Key is pressed.
     CASE
        IF input==-1 THEN  END;  // Capturing a minute timeout.
        ....
     END;
  END;
  IF TYPE(input)==6 THEN  // Touch screen pressed.
    IF input(1)==#0h THEN
       cx:=B->R(input(2));  // Convert x part.
       cy:=B->R(input(3));  // Convert y part.
    END;
  END;
 END;
UNTIL input==19;  // Backspace key pressed.
.....

I use HP-16C, WP-34S emulator, HP-35s, HP-48GX, HP-50g, and HP Prime G2.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Controlling program exit - cahlucas - 11-13-2020 05:03 PM
RE: Controlling program exit - cahlucas - 11-13-2020, 10:16 PM
RE: Controlling program exit - Han - 11-13-2020, 10:44 PM
RE: Controlling program exit - cahlucas - 11-13-2020, 11:08 PM
RE: Controlling program exit - Jacob Wall - 11-14-2020, 04:31 PM
RE: Controlling program exit - cahlucas - 11-15-2020, 07:55 PM
RE: Controlling program exit - Jacob Wall - 11-15-2020, 10:58 PM
RE: Controlling program exit - cahlucas - 11-17-2020, 05:31 PM
RE: Controlling program exit - Jacob Wall - 11-17-2020, 09:08 PM
RE: Controlling program exit - cahlucas - 11-18-2020, 05:55 PM
RE: Controlling program exit - Han - 11-17-2020, 10:15 PM
RE: Controlling program exit - Han - 11-18-2020, 09:41 PM
RE: Controlling program exit - cahlucas - 11-20-2020, 01:59 AM
RE: Controlling program exit - Han - 11-21-2020, 04:53 PM
RE: Controlling program exit - cahlucas - 11-21-2020, 11:54 PM
RE: Controlling program exit - Han - 11-30-2020, 01:57 AM
RE: Controlling program exit - cahlucas - 11-30-2020, 10:01 PM



User(s) browsing this thread: 1 Guest(s)