Post Reply 
Calling the contents of an identifier
03-14-2017, 12:51 AM (This post was last modified: 03-14-2017 01:19 AM by Han.)
Post: #4
RE: Calling the contents of an identifier
Your program seems extremely convoluted. There is no reason to request a "type 8" object when you are simply going to treat the input as a string anyway. (In other words, why not just use strings?) Also, why create a CAS program that does nothing but call non-CAS programs? A more straightforward approach is to simply do it all in non-CAS programs.

Don't use EXPR() if you don't want variables evaluated. Use CAS() instead.

Code:
export resetFunctionAppVars( varApp_str )
BEGIN
  EXPR(EVAL(varApp_str + ":=" + string(""))); 
  return("Done");
END;

export SetFunctionAppVars( varApp_str )
BEGIN
  local symbExpr, resetVALUE_FX, initVALUE_FX;
  IFERR
    initVALUE_FX := string(EXPR(varApp_str));
  THEN
    initVALUE_FX := "";
  END;
  resetVALUE_FX := "X^2/9";

  if 
  (
    input( 
    { { symbExpr, [ 2 ] } }, 
    "Set Function App Vars",
    varApp_str+"(X):",
    "Enter Symbolic Expression for "+varApp_str+"(X)",
    resetVALUE_FX, 
    initVALUE_FX
    )
  )
  then
    CAS(EVAL(varApp_str + ":=(X)->" + symbExpr));
    return(1); 
  end;
  return(0);
END;

EXPORT PRGCAS()
BEGIN
    SetFunctionAppVars( "F1" );
    SetFunctionAppVars( "F2" );
    return("Done");
END;

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Calling the contents of an identifier - Han - 03-14-2017 12:51 AM



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