HP Forums
Loop Forever? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Loop Forever? (/thread-4546.html)



Loop Forever? - toml_12953 - 08-20-2015 03:17 PM

In ISO BASIC, there's a way to loop forever (you can always EXIT a loop from within)
Code:

DO
  <code goes here>
LOOP

Is there a way to do that on Prime?

Right now I have this which seems very clumsy:
Code:

REPEAT
  <code goes here>
UNTIL 1≠1;

Tom L


RE: Loop Forever? - Didier Lachieze - 08-20-2015 04:03 PM

You can do:
Code:
REPEAT
  <code goes here>
UNTIL 0;
or
Code:
WHILE 1 DO
  <code goes here>
END;



RE: Loop Forever? - smp - 08-20-2015 05:28 PM

For me,
Code:
WHILE 1 DO
  <your code goes here>
END;
has been something of a standard way to get that done.

smp