HP Forums

Full Version: apply in the program [Solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The function apply(x-> x ^ 3, [1,2,3]) works when writing alone.
[Image: Bi88k.jpg] [Image: 2s8ew.jpg]
In a program can not display the result. Can you help me?
[Image: XeH4R.jpg]
EXPORT meusymp2()
BEGIN
LOCAL x,B,V,G,L;
INPUT(B,"DIGITE B");
INPUT(V,"DIGITE X");
INPUT(G,"DIGITE G");
L:=CAS.apply(x(x*3),[[B],[V],[G]]);
RECT;
TEXTOUT_P(L,120,30,2,#000000h,190,#99FF00h);
FREEZE;
END;
Here is a (simplified) structure that may be of some help(?)

Code:

EXPORT meusymp2()
BEGIN
  LOCAL x;                                         //  avoiding reserved variable issues
  RECT;

  M0:=[1,2,3];                                     //  Default values
  M1:=CAS.apply("x->x^3",M0);                      //  Uses matrix reserved variables
  
  TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
  wait;                                            //  replaces FREEZE;

END;
(12-22-2015 06:04 PM)DrD Wrote: [ -> ]Here is a (simplified) structure that may be of some help(?)

Code:

EXPORT meusymp2()
BEGIN
  LOCAL x;                                         //  avoiding reserved variable issues
  RECT;

  M0:=[1,2,3];                                     //  Default values
  M1:=CAS.apply("x->x^3",M0);                      //  Uses matrix reserved variables
  
  TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
  wait;                                            //  replaces FREEZE;

END;

Thanks DrD!
see :
EXPORT meusymp2()
BEGIN
LOCAL x,B,V,G,L;
INPUT(B,"DIGITE B");
INPUT(V,"DIGITE V");
INPUT(G,"DIGITE G");
M0:=[B,V,G];
M1:=CAS.apply("x->x^3",M0);
RECT;
TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
WAIT;
END;
[Image: kEduk.jpg]
Reference URL's