HP Forums

Full Version: STARTVIEW and Programming
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
It seems it does not:

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

-road
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;
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).
Reference URL's