HP Forums
STARTVIEW and Programming - 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: STARTVIEW and Programming (/thread-16609.html)



STARTVIEW and Programming - Eddie W. Shore - 04-06-2021 12:17 AM

Does STARTVIEW automatically terminate a program? If it does, the user will not be able to solve an equation and stay in a program.

I received an email asking me advice for an equation library.

Example:

Code:
EXPORT sampleprgm()
LOCAL mh, ch, d;

mh:=2;   // after each calculation ask the user if they want to exit the program (1.  yes,  2. no)

WHILE mh==2 DO

// main menu
CHOOSE(ch,"title",list of choices);

// one of the menu choices
IF ch==1 THEN
CHOOSE(d,"title",list of choices_submenu);

IF d==1 THEN
calculations and commands here
[b]STARTVIEW(2,1)[/b]
CHOOSE(mh,"Quit?",{"Yes","No"});
END;    // end submenu choice (d)

END;   // end main menu choice (ch)
...
END;   // end the while loop



RE: STARTVIEW and Programming - roadrunner - 04-07-2021 12:26 AM

It seems it does not:

PHP Code:
EXPORT teststartview()
BEGIN
 MSGBOX
("before startview");
 
STARTVIEW(2);
 
MSGBOX("after startview");
END

-road


RE: STARTVIEW and Programming - Eddie W. Shore - 04-07-2021 02:54 PM

It leaves the startview as it's final destination.

Check this code out:

Code:
EXPORT teststartview2()
BEGIN
 MSGBOX("before startview");
 STARTVIEW(2);
 MSGBOX("after startview");
 INPUT(A);
 B:=A+1;
 PRINT("B = "+STRING(B));
END;



RE: STARTVIEW and Programming - C.Ret - 04-07-2021 07:36 PM

Hello,

I see nothing special here, all seem to act as expected !?

If you want to terminate your code at the HOME or CAS view, you just have to specify it:

Code:
EXPORT teststartview2()
BEGIN
 MSGBOX("before startview");
 STARTVIEW(2);                                   // Activate the Numeric View (exact display depending of the curent Application ) 
 MSGBOX("after startview");
 INPUT(A);
 B:=A+1;
 PRINT("B = "+STRING(B));
 STARTVIEW(-1)                                 // Activate the HOME or CAS view just before the end of code
END;

See the inline ?-Help key for the different available views (specific to the current Application, user customized or global).