Post Reply 
REPEAT . . . UNTIL loop problem
02-15-2021, 11:03 PM (This post was last modified: 02-15-2021 11:05 PM by cahlucas.)
Post: #20
RE: REPEAT . . . UNTIL loop problem
Here is the framework of my program, at least the part where you can derive control from. I will not publish the entire program here, to keep the overview as simple as possible. Things unrelated to program control have been left out. But this should be enough to track down the error. I hope you can find it. Sincerely, Karel.

Code:


#pragma mode( separator(.,;) integer(h32) )

CURSORTOUCH(n,cx,cy);

START()
BEGIN
 LOCAL N,input,exit,,cx,cy;
 input:=−1;  exit:=0; 
 
 REPEAT
  input:=WAIT(−1);
  CASE
    IF N==0 THEN  END;
    IF TYPE(input)==6 THEN
      CASE
        IF input(1)==#0h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#1h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#2h THEN
        
        END;
        IF input(1)==#3h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#4h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#5h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#6h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
        IF input(1)==#7h THEN
        cx:=B→R(input(2));
        cy:=B→R(input(3));
        END;
      END;
      CURSORTOUCH(N,cx,cy);
    END;
   IF TYPE(input)==0 THEN 
    CASE
     . . .    // More  IF  THEN  END  statements
     IF input==−1 THEN  END;
     IF input==19 THEN exit:=1 END;
     . . .     // More  IF  THEN  END  statements
     IF input==37 THEN N:=4 END;
     IF input==38 THEN N:=5 END;
     IF input==39 THEN N:=6 END;
     . . .     // More  IF  THEN  END  statements
     DEFAULT END;
    END;
  END;
  CASE  // Display section,  This part manages the screen.
    IF N==4 THEN . . . END;
    IF N==5 THEN . . . END;
    IF N==6 THEN . . . END;
  END;
  FREEZE;
 UNTIL exit==1;
 STARTVIEW(−4,1);
END;

CURSORTOUCH(n,cx,cy)
BEGIN
 . . .     // Part where x and y coordinates are processed.
END;


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
REPEAT . . . UNTIL loop problem - cahlucas - 02-13-2021, 10:50 PM
RE: REPEAT . . . UNTIL loop problem - cahlucas - 02-15-2021 11:03 PM
RE: REPEAT . . . UNTIL loop problem - jte - 01-20-2023, 02:57 AM



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