Difference between revisions of "TI-BASIC:System Variables"

From Learn @ Cemetech
Jump to navigationJump to search
(Initial automated import)
 
(Automated internal link correction)
 
Line 7: Line 7:
 
* Evaluating them at a point, using the syntax EqVar(''value'') - for example, Y,,1,,(5). This will plug ''value'' in for the independent variable - X, T, θ, or ''n'' for function, parametric, polar, and sequential variables respectively.
 
* Evaluating them at a point, using the syntax EqVar(''value'') - for example, Y,,1,,(5). This will plug ''value'' in for the independent variable - X, T, θ, or ''n'' for function, parametric, polar, and sequential variables respectively.
 
* Storing a string to them.
 
* Storing a string to them.
* Using the [[TI-BASIC:Equ►String(|Equ►String(]] or [[TI-BASIC:String►Equ(|String►Equ(]] command to go back and forth from string to equation form.
+
* Using the [[TI-BASIC:Equ►String(|Equ►String(]] or [[TI-BASIC:String_Equ|String►Equ(]] command to go back and forth from string to equation form.
  
 
In addition to their string contents, an equation variable contains two other pieces of information - the graphing style, set with the [[TI-BASIC:Graphstyle|GraphStyle(]] command, and the state (enabled or disabled), set with the [[TI-BASIC:Fnon|FnOn]] and [[TI-BASIC:Fnoff|FnOff]] commands. There is unfortunately, no way to find out which graphing style or state a variable is in, you can only set these to a value.
 
In addition to their string contents, an equation variable contains two other pieces of information - the graphing style, set with the [[TI-BASIC:Graphstyle|GraphStyle(]] command, and the state (enabled or disabled), set with the [[TI-BASIC:Fnon|FnOn]] and [[TI-BASIC:Fnoff|FnOff]] commands. There is unfortunately, no way to find out which graphing style or state a variable is in, you can only set these to a value.

Latest revision as of 23:22, 24 February 2016

System variables are, for the purposes of this guide, variables that certain commands will use or modify without asking (i.e. without supplying them in the command's arguments). This is a somewhat ill-defined category, and in fact the system variables we'll discuss are of a somewhat miscellaneous nature. They include equation and plot variables, window and table parameters, statistical variables, and finance variables.

Equation variables and plot variables

The equation variables include Y,,0,, through Y,,9,, (function variables), X,,1T,, and Y,,1T,, through X,,6T,, and Y,,6T,, (parametric variables), r,,1,, through r,,6,, (polar variables), and u, v, w (sequential variables). They are used when graphing an equation on the graph screen. From the point of view of a programmer, it's important to realize that these variables are actually Strings in disguise. That is to say, they are stored internally as strings, though the string operations and commands won't work on them. Instead, the following operations are valid for equations:

  • Evaluating them, by using the equation variable in an expression.
  • Evaluating them at a point, using the syntax EqVar(value) - for example, Y,,1,,(5). This will plug value in for the independent variable - X, T, θ, or n for function, parametric, polar, and sequential variables respectively.
  • Storing a string to them.
  • Using the Equ►String( or String►Equ( command to go back and forth from string to equation form.

In addition to their string contents, an equation variable contains two other pieces of information - the graphing style, set with the GraphStyle( command, and the state (enabled or disabled), set with the FnOn and FnOff commands. There is unfortunately, no way to find out which graphing style or state a variable is in, you can only set these to a value.

Plot variables are used for displaying data graphically, in one of six styles: scatter plot, line plot, histogram, box plot, modified box plot, and normal plot. What the variables actually store varies with the plot type, but includes one or more data lists, and settings. All of this can be set with the PlotN( command. All or some plots can be turned on and off with the PlotsOn and PlotsOff commands. The Select( command is also useful for dealing with plots.

Window and table parameters

These store auxiliary information about the graphing window and include:

  • Xmin, Xmax, Ymin, Ymax -- determine the lower and upper X and Y bounds of the graph screen itself.
  • ΔX, ΔY -- defined to be (Xmax-Xmin)/94 and (Ymax-Ymin)/62 respectively; storing to them will change Xmax and Ymax to arrange this.
  • Xscl, Yscl -- determine how wide the marks on the axes (and, with GridOn, the grid marks) are spaced.
  • Xres -- determines the quality of Function graphing (how many pixels apart points are calculated), and must be an integer 1-8.
  • Tmin, Tmax, Tstep -- determine the values at which T is evaluated in Parametric graphing (as though it were a For( loop).
  • θmin, θmax, θstep -- the same idea, but for the θ variable in Polar graphing.
  • nMin, nMax -- bounds for the n variable to evaluate (the step is always 1; also, these must be integers).
  • u(nMin), v(nMin), w(nMin) - override the value of u, v, and w at nMin, for the purposes of recursively defining them.
  • PlotStart, PlotStep -- actually have nothing to do with plots, but determine which values of n are graphed.
  • all of the above have a Z equivalent (ZXmin, Zθstep, etc.) that's used by ZoomSto and ZoomRcl.
  • XFact, YFact -- the scaling factors for Zoom In and Zoom Out.
  • TblStart, ΔTbl -- the starting value and step for the independent variable in the table screen.
  • TblInput -- a 7-element list of the values of a variable in the table.

When transferring variables between calculators, or grouping variables, these variables are grouped in Window, rclWindow, and TblSet.

You can store to each of the window variables directly, or use the Zoom commands, which affect multiple variables at once to achieve some effect.

Statistical Variables

These cannot be stored to, although their values can be used - instead they are modified by statistical commands, which use them as output. See the Statistics pages for more information.

Finance Variables

The seven finance variables are N, I%, PV, PMT, FV, P/Y, and C/Y. They are used by the finance solver tool; to use the solver in a program, set these variables to the values you want, choose one of the options Pmt_End or Pmt_Bgn, and then use the value tmv_VAR (where VAR is the variable you want to solve for).

Another use of the finance variables is in speed-critical sections of code: they are faster to access even than Ans. Somewhat off-setting this advantage is the fact that they are two byte tokens, and that they don't work as the variables of a seq( command or a For( loop (they will actually throw a ERR:SYNTAX error) or [[|is|IS>(]] and DS>(. In addition the value of C/Y is altered when P/Y is altered.