HP Forums
FREEZE instruction - 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: FREEZE instruction (/thread-412.html)



FREEZE instruction - Bob Frazee - 01-12-2014 12:35 AM

Here's the code;
Code:
EXPORT Test()
BEGIN
STARTVIEW(-1,1);
TEXTOUT("1: Var1 ",-15,9);
FREEZE;
//WAIT(0);
TEXTOUT("1: Var2 ",-15,7);
//FREEZE;
TEXTOUT("1: Var3 ",-15,5);
//FREEZE;
END;

FREEZE definition;
Pauses program execution until a key is pressed. This
prevents the screen from being redrawn after the end of
the program execution, leaving the modified display on
the screen for the user to see.

Well... It does appear to FREEZE the screen, After it prints all 3 vars. If I put WAIT(0) in the code, it waits at var 1, then prints var2 and var3 and then FREEZE's?. I'm somewhat confused. Is this the intended behavior of the FREEZE instruction?
rcf


RE: FREEZE instruction - Han - 01-12-2014 12:40 AM

It is used to prevent the system from updating the display, generally after the program finishes. FREEZE does not halt the program, so using FREEZE multiple times in a program does not really make much sense. When most programs on the Prime finish, we are generally shown a popup window of either the value returned by the program, or the value of the last command issued just as the program ends. This screen, of course, updates the display. So if you have a nice image you want to remain on the screen after the program is done, use FREEZE to prevent the system's internal display routines from refreshing the screen.


RE: FREEZE instruction - patrice - 01-12-2014 04:12 AM

Another catch with FREEZE is that if there is an error in your program after the FREEZE, you will not see the error message.