Post Reply 
STARTVIEW and Programming
04-06-2021, 12:17 AM
Post: #1
STARTVIEW and Programming
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
Visit this user's website Find all posts by this user
Quote this message in a reply
04-07-2021, 12:26 AM
Post: #2
RE: STARTVIEW and Programming
It seems it does not:

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

-road
Find all posts by this user
Quote this message in a reply
04-07-2021, 02:54 PM
Post: #3
RE: STARTVIEW and Programming
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;
Visit this user's website Find all posts by this user
Quote this message in a reply
04-07-2021, 07:36 PM (This post was last modified: 04-07-2021 07:40 PM by C.Ret.)
Post: #4
RE: STARTVIEW and Programming
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).
Find all posts by this user
Quote this message in a reply
Post Reply 




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