HP Forums
Quadratic Explorer App - 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: Quadratic Explorer App (/thread-7218.html)



Quadratic Explorer App - compsystems - 11-10-2016 02:36 PM

Hello,
I want to swich from the "terminal view" to the application "Quadratic Explorer App",
but only at the end of the program is changed to the application, does not follow the logic of the algorithm


PHP Code:
#cas 
    
dinamicLkn_quadExplorer():=
    
begin
        local coeff
polrootsdiscriminant;
        print; 
// clear terminal view
        // freeze;

        
print("Current view: TERMINAL VIEW");
        
coeff := [0.5, -32.5];
        
pol := SLIST(coeff.*seq('x'^k,k,2,0));
        
//roots := SOLVE(0.5, -3, 2.5); 
        //roots := SOLVE(pol[1], pol[2], pol[3]);
        
roots := Quadratic_Explorer::SOLVE(0.5, -32.5);

        print( 
"COEF: " coeff ); 
        print( 
"POL: " pol ); 
        print( 
"ROOTS: x1 = " roots[1] + ", x2 = " roots[2] );
        
discriminant := DELTA(0.5, -32.5);
        print( 
"DISCRIMINAT: D = " discriminant ); wait();

        
startapp("Quadratic_Explorer");  wait(); //  current: Quadratic_Explorer


         
startview(1);


        print(
"Again on the terminal view"); wait();   // return to terminal view  & Wait for a key  ...

        
return "done"//Returns an output value (string) 
    
end;
#end 

request: the Quadratic_Explorer() CMD Should initialize the polynomial expression of the quadratic function.

Quadratic_Explorer(a,b,c); // A*X^2+B*X+C
Quadratic_Explorer(0.5, -3, 2.5);

[Image: QuadraticExplorerApp_hp_prime_image00.png]


RE: Quadratic Explorer App - Carlos295pz - 11-10-2016 08:52 PM

Quadratic_Explorer() is a default function that has no value, a program can not be empty.

You can call an app using STARTAPP ("name");


RE: Quadratic Explorer App - cyrille de brébisson - 11-14-2016 06:03 AM

Hello,

The startApp command will start the app. Meaning that it makes it active (and starts its main view)...

However, the view will not become interractive with the user until the program completes...

Unfortunately, there is no way, at this point in time, for you to programmatically start the view, let the user do something there and then continue your program when he is done.

Cyrille


RE: Quadratic Explorer App - Jean-Michel - 11-14-2016 12:17 PM

(11-14-2016 06:03 AM)cyrille de brébisson Wrote:  Hello,

[...]
However, the view will not become interractive with the user until the program completes...

Unfortunately, there is no way, at this point in time, for you to programmatically start the view, let the user do something there and then continue your program when he is done.

Is this true for ALL applications including Geometry?
I'm currently writing a program that computes coordinates of 2D points that I want to draw (as well as segments joining them) in the Geometry App to simulate the rotation of a cube, knowing that these computations (ccordinates conversion during roation) are based on x and y coordinates of a point on the Geometry view, moved by the finger (as "sliders").
At the end, horizontal and vertical movements of the finger on the screen wezre supposed to pilot the rotation of the pseudo 3D cube, in an interactive way.

I was able to have these conversions writen in the Symbolic view of the Geometry App at the time there I considered one single rotation, but since I want to have two at the same time, equation get too long and this is the reason why I wanted to write them in a program.
How should I proceed then?

Kind regards.
Jean-Michel.


RE: Quadratic Explorer App - cyrille de brébisson - 11-15-2016 06:10 AM

Hello,

Programatically, you can do a STARTVIEW to start a specific view. STARTVIEW also allows you to force a redraw of the view while the program is executing.
This allows you to force a display, but will not provide interactivity.

Cyrille


RE: Quadratic Explorer App - compsystems - 11-21-2016 09:12 PM

startview(1); in the code above does not change between views =(

I think there must be a way to switch since "Terminal_View" to another view STARTAPP("Terminal_View");, and "freeze" the current application, For now no dynamic link, only switch between views.

Also without arguments should return the current app as string, so that at the end of the program restore the initial view
STARTAPP(); -> "Quadratic_Explorer"


PHP Code:
currentAPP := STARTAPP(); // store the begin app
...
 
STARTAPP(currentAPP); // restore the begin app