Post Reply 
REPEAT . . . UNTIL loop problem
02-14-2021, 01:24 AM (This post was last modified: 02-14-2021 03:27 AM by toml_12953.)
Post: #6
RE: REPEAT . . . UNTIL loop problem
(02-13-2021 10:50 PM)cahlucas Wrote:  Hi all,
This time I have a loop problem that I cannot solve. For a graphics program, I have a REPEAT - UNTIL loop as the outermost program loop to keep the program running until it ends, see the code below. Somewhere in the code, the value 1 is stored in the variable 'exit' when a certain key is pressed. I get a 'syntax error' when I press the menu key 'Cntrl.', whereby the cursor is just in front of the UNTIL. As far as I can tell there is nothing wrong with the code, but I don't understand where that error message is coming from. Maybe someone can give me an idea to solve this problem. I hope to hear from you soon. Sincerely, Karel.
This works for me. Are you sure you have exit:=1 in a proper conditional?

Code:

EXPORT TESTEX()
BEGIN

LOCAL y:=0,exit:=0;

REPEAT
  print(y);
  y:=y+1;
  IF y==7 THEN
    exit:=1;
  END;  // If you leave this out, you'll get an error on the UNTIL statement.
UNTIL exit==1;

END;

Tom L
Cui bono?
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 - toml_12953 - 02-14-2021 01:24 AM
RE: REPEAT . . . UNTIL loop problem - jte - 01-20-2023, 02:57 AM



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