HP Forums

Full Version: REQUEST: warning messages inside a popup "window"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

The warning messages that launch some CAS commands current are displayed in the TERMNAL view, this "damages" the output of a program =(
The output must be in a popup "popup" window, closed with [ESC]

THE PRINTED OUTPUTS ONLY MUST BE USER, NOT SYSTEM

Try the following script
PHP Code:
#cas
  
script1():=
  
begin
    local eq1
eq2solanswer;
      print;
    
purge(x,y);
      print(
"Find the dimensions of a rectangle whose area is 45 and its perimeter 28");

    print(
"");
    print(
"METHOD 1 (Algebraic solution, stepwise)");
        print(
"Let x = long, y = width");
   print(
"");

        print(
"The equations are:");    
    
eq1:=x*y=45;    
    print(
"eq1: "+eq1); 
    
eq2:=2x+2y=28
    print(
"eq2: "+eq2); 

    print(
"");
    
answer:=factor(eq2); // -> (2*(x+y)) = 28
    
print("factor(eq2): "+answer);

    print(
"");
    
answer:=answer/2// ->(2*(x+y)/2) = 14
    
print("Ans/2: "+answer);
    
answer:=simplify(answer); // -> (x+y) = 14
    
print("simplify(Ans): "+answer);

    print(
"");
    
sol:= y=solve(answer,y)[1]; //  y = (-x+14)
    
print("sol(Ans,y): "+sol);

    print(
"");
    
answer:= (eq1|sol);
    
answer:=subst(eq1,sol); //  -> (x*(-x+14)) = 45
    
print("subst(eq1,answer): "+answer);
    
answer:=simplify(answer); // -> (-x^2+14*x) = 45
    
print("simplify(Ans): "+answer);

    print(
"");
    
sol:=solve(answer,x); // -> {5,9}
    
print("sol(Ans,x): x1,2="+sol);

    print(
"");
    print(
"test solutions");
    
answer:= (eq1|{x=sol[1], y=sol[2]});
    print(
"eq1: "+answer); // -> 45=45
    
answer:=evalBool(answer,'=','==');
    print(
"eq1: "+answer); // true

    
print("");
    
answer:=(eq2|{x=sol[1], y=sol[2]});
    print(
"eq2: "+answer); // -> 28=28
    
answer:=evalBool(answer,'=','==');
    print(
"eq2: "+answer);
    return 
"Done"
  
end;
#end

#cas
  
evalBoolexpr1str1str2 ):=
  
begin
   
return( iftesubst(expr1str1str2 ), "TRUE""FALSE") );
  
end;
#end 

[Image: terminalView_warningMessages_imagen00.png]
Reference URL's