Post Reply 
Understanding variables relative to the current active App
12-27-2013, 10:51 PM
Post: #1
Understanding variables relative to the current active App
Variables can have different contents and behavior depending on the current active App that is displayed at the top of the screen in Home or CAS view. This is because certain Apps have their own predefined variables that can supersede variables that have been created as User or CAS variables. For example, If you enter PMT in Home view, you will normally see P*M*T followed by the product of the contents of global reserved real variables P, M and T. However, if the Finance App is active, you will see PMT followed by the value of the payment value that shown in the Finance App. If you store a different value in PMT from Home view, it will then appear in the Finance App view. If, however, a different App such as Solve is active and you try to store a value in PMT, you will be asked if you want to create a variable named PMT and it will now appear as a User variable. If you make the Finance App active again, the value of PMT will not have changed. If you enter the User variable from the user menu, it will be the same as in the Finance App view, but if you return to another App that does not have a built-in variable PMT, then you will get back what you stored initially when the user variable was first created.

A similar situation occurs with the cell location names in the Spreadsheet App. It is especially important not to create CAS variables with the same names as App variables in PPL programs, since unpredictable results and crashes can occur if the variables are used or assigned values while the App is active. This is because the CAS variable can change type, such as a matrix becoming a list. Also, a CAS variable cannot be created if a variable of the same name already exists in the active App, e.g. a11 with a Spreadsheet App active.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Understanding variables relative to the current active App - Michael de Estrada - 12-27-2013 10:51 PM



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