Post Reply 
Global Variables?
04-03-2017, 01:18 PM (This post was last modified: 04-03-2017 03:07 PM by compsystems.)
Post: #7
RE: Global Variables?
Even with correct data generates an error, I think because a reserved variable is global for all programs and not a specific one.

The compiler should say the cause of the problem, instead of just SYNTAX ERROR

PHP Code:
X:=100;
M1:=MAKEMAT(0,100);
export testUserAndAppVars()
begin
  
PRINT();


  
//USER VARS
  
:= 1B:=2;
  
:= 5.9;
  
L1 := {1,{2},"HELLO"};
  
M1 := [[1,2,3],[4,5,6]];
  
Z1 := 3+4*i;


  
// APP VARS
  
PRINT( "F(X) Function app user symbolic variables" );
  Function.
F1 := 'X^3-6*X^2+11*X-6'// OR F1 := 'X^3-6*X^2+11*X-6'; OR CAS("F1(X):=X^3-6*X^2+11*X-6"); or sto('X^3-6*X^2+11*X-6',F1);
  
F2 := 'X^2-3*X+2';
  
F0 := 'X^3-0*X^2+X';
  
CAS("F3(X):=X^3"); // usando CAS CMD
  
CAS("F4(X):=X^3-2");
  
sto('X+5',F5); // usando STO CMD

  
PRINT( "F1(X) = " + Function.F1 );
  PRINT( 
"F2(X) = " + Function.F2 );
  PRINT( 
"F3(X) = " + Function.F0 );
  PRINT( 
"" );


  PRINT( 
"V(X,Y) Advanced Graphing app user symbolic variables" );    
  
V1 := 'X^2+Y^2 = 10';
  
V2 := '2*X-3*Y = 6';
  
V3 := 'Y MOD X = 3';
  
Advanced_Graphing.V4 := Function.F1+'Y'// usando dot


  
PRINT( "V1(X,Y) = " Advanced_Graphing.V1 );
  PRINT( 
"V2(X,Y) = " Advanced_Graphing.V2 );
  PRINT( 
"V3(X,Y) = " Advanced_Graphing.V3 );
  PRINT( 
"" );


  PRINT( 
"{ X(T), Y(T) } PARAMETRIC app user symbolic variables" ); 
  
Y1 := 'SIN(4*T)';
  
X1 := 'SIN(6*T)';
  PRINT( 
"{ X1(T) = " Parametric.X1 ", Y1(T) = " Parametric.Y1 " }" );
  PRINT( 
"" );

  PRINT( 
"R(THETHA) POLAR app user symbolic variables" );
  
R1 := 'SIN(θ)';
  PRINT( 
"R(θ) = " Polar.R1 );
  PRINT( 
"" );

  PRINT( 
"EQ() SOLVE app user symbolic variables" );
  
E1 := 'X^2';
  
E2 := '2*X+3';
  PRINT( 
"{ E1(X) = " E1 ", E2(X) = " E2 " }" );
  PRINT( 
"END" );

  
//User Vars
  // {"A", "B", "X","L1","M1","Z1","F1","F2","F0","V1","V2","T"})

  //F(X) Function symbolic variables
  // { "F0","Function.F1","F1", "F2","F3","F4","F5","F6","F7","F8","F9" }

  // V(X,Y) Advanced Graphing symbolic variables 
  // { "V0","V1","V2","V3","V4","V5","V6","V7","V8","V9" }

  // { X(T), Y(T) } PARAMETRIC symbolic variables
  // { "X0","X1","X2","X3","X4","X5","X6","X7","X8","X9" }
  // { "Y0","Y1","Y2","Y3","Y4","Y5","Y6","Y7","Y8","Y9" } 

  //R(THETHA) POLAR symbolic variables
  // { "R0","R1","R2","R3","R4","R5","R6","R7","R8","R9" }


  
return "Done";
end
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Global Variables? - toml_12953 - 04-03-2017, 12:40 AM
RE: Global Variables? - Joe Horn - 04-03-2017, 02:10 AM
RE: Global Variables? - toml_12953 - 04-03-2017, 02:59 AM
RE: Global Variables? - Han - 04-03-2017, 03:02 AM
RE: Global Variables? - toml_12953 - 04-03-2017, 10:11 AM
RE: Global Variables? - jte - 08-15-2021, 12:27 AM
RE: Global Variables? - Joe Horn - 08-15-2021, 12:49 AM
RE: Global Variables? - jte - 08-15-2021, 01:22 AM
RE: Global Variables? - Joe Horn - 08-15-2021, 03:57 AM
RE: Global Variables? - DrD - 04-03-2017, 10:25 AM
RE: Global Variables? - toml_12953 - 04-03-2017, 04:39 PM
RE: Global Variables? - cahlucas - 08-18-2021, 04:37 AM
RE: Global Variables? - toml_12953 - 08-18-2021, 09:55 AM
RE: Global Variables? - cahlucas - 08-19-2021, 04:50 AM
RE: Global Variables? - toml_12953 - 08-19-2021, 08:57 AM
RE: Global Variables? - Stevetuc - 08-19-2021, 03:38 PM
RE: Global Variables? - jte - 01-20-2023, 02:46 AM
RE: Global Variables? - cahlucas - 08-20-2021, 04:04 PM
RE: Global Variables? - toml_12953 - 08-20-2021, 06:26 PM
RE: Global Variables? - compsystems - 04-03-2017 01:18 PM



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