Post Reply 
Bug(?) in STARTVIEW()
09-11-2018, 06:17 PM
Post: #1
Bug(?) in STARTVIEW()
So, I'm in the process of writing an HP Prime app, more to see how well I understand the process than anything else. I have a solid background in RPN and RPL so HP-PPL is new to me.

As I understand it, STARTVIEW(view, redraw) in an app when view>0 should bring up the view that's displayed when the app is the active app and the user presses on one of Symb, Plot, Num, Shift-SymbSetup etc. according to p648 of the current user guide timestamped Jan 12th 2018.

In particular, if view is 3 then you get the SymbSetup page.

Now consider this program that is generated when you create a new app that inherits from no others -- an empty app, basically -- and uncomment everything:

Code:
#pragma mode( separator(.,;) integer(h32) )

Symb()
BEGIN
 MSGBOX("Symb");
END;

Plot()
BEGIN
 MSGBOX("Plot");
END;

Num()
BEGIN
 MSGBOX("Num");
END;

SymbSetup()
BEGIN
 MSGBOX("SymbSetup");
END;

PlotSetup()
BEGIN
 MSGBOX("PlotSetup");
END;

NumSetup()
BEGIN
 MSGBOX("NumSetup");
END;

Info()
BEGIN
 MSGBOX("Info");
END;

START()
BEGIN
 STARTVIEW(3,1);
END;

RESET()
BEGIN
 MSGBOX("RESET");
END;

VIEW "Views", Views()
BEGIN
 MSGBOX("Views");
END;

Note the change that I made to the START() function.

Now, if I hit Shift-SymbSetup, I get the following screen, as expected given the SymbSetup() function in the program:

[Image: scrn.png]

Note that my START() function calls STARTVIEW(3,1), which should give me the same thing as above when I start the app given that it's supposed to open the SymbSetup view, right?

Wrong.

It gives me the SymbSetup view that I would get if I had not defined my own function to override it:

[Image: scrn2.png]

Is this the intended behaviour or am I missing something here?
Find all posts by this user
Quote this message in a reply
09-11-2018, 08:41 PM
Post: #2
RE: Bug(?) in STARTVIEW()
Hi, it's not a bug, I think it's more an access to the native views, what I would also like is that can use a STARTVIEW for the redefined views, and only entering to the last view executed, even when several views have been called at the same time.

Before I made an requested about it, but it seems complicated
(03-14-2017 12:59 PM)Carlos295pz Wrote:  Variables:
  • Applications // Return list of all calculator applications, current app.
  • HFonts // Returns system font size.


Functions:
  • STARTVIEW (-10) // Start View [-1 does not distinguish between Start and CAS]
  • STARTVIEW (-11) // CAS View
    [For correct handling of redefined Apps, pressing HOME and CAS keys]
    Views redefined by application program:
  • STARTVIEW (8) // Symbolic view redefined (Symb BEGIN END)
  • STARTVIEW (9) // Graphic view redefined (Plot BEGIN END)
  • STARTVIEW (10) // Numeric view redefined (Num BEBIN END)
  • STARTVIEW (11) // Setup Symbolic view redefined (SymbSetup BEBIN END)
    ...
    [This can be achieved with nesting, but it would be beneficial to be able to access without resorting to this.]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
09-12-2018, 05:27 AM
Post: #3
RE: Bug(?) in STARTVIEW()
Hello,

The behavior is correct. Was it not the case, you would not be able, in a view redefine, to do something and then start the "normal" view.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
09-12-2018, 07:29 AM
Post: #4
RE: Bug(?) in STARTVIEW()
Carlos, Cyrille,

Thanks for your input. I'll just have to call the overridden SymbSetup() from my START() function.

Cyrille, bien compris la logique derrière ce choix mais dans ce cas, la suggestion de Carlos permettant de démarrer la vue redéfinie à l'aide de STARTVIEW me paraît idéale. Est-ce qu'il y a une raison particulière pourquoi elle n'a pas été implémentée ? (à part "on n'a pas encore eu le temps"...)
Find all posts by this user
Quote this message in a reply
09-13-2018, 06:37 AM
Post: #5
RE: Bug(?) in STARTVIEW()
Hello,

Never thought about implementing such a function. I guess I assumed that you can call your own progrm's function directly if this is what you want to do.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




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