next up previous contents
Next: 6.2 Arithmetic expressions Up: 6. FORTRAN style interpreter Previous: 6. FORTRAN style interpreter

   
6.1 Variables

All variables are denoted by a name, immediately followed by a left square bracket [, one or more indices and a right square bracket ].

Example : i[1], r[0], i[i[1]], x[1,2]

The left square brackets must immediately follow the name of the variable. Blanks within the square brackets are not significant. The index can be any integer expression, especially any of the integer variables again. Two free variables are provided, an integer, i[n], and a real, r[n] variable. Each of these variables is actually an array of dimension n given in squared brackets. The allowed range for n is 0 to MAXPARAM, which is defined at compilation time by the parameter MAXPARAM in the file `param.inc', see appendix B for further help.

Beside these variables i[n] and r[n] for general use a large variety of variables is linked to information of the currently loaded data sets in KUPLOT. Some of these variables can not be modified, others like the individual values of data sets can be altered, thus allowing to modify the loaded data. Table 6.1 shows a summary of data related variables. The values of these variables marked with * are read-only and can not be altered. Note that the variable 'n[1]' $\star$]$\star$can now be overwritten, however this results in data sets being lost. To allocate space for a new data set use the command 'allocate', just increasing the value of 'n[1]' will not work. One possible application for example is to remove just the last data set rather than using 'rese' and loading all other data sets again. The following line would just remove the last data set:

   n[1] = n[1]-1


 
Table 6.1: KUPLOT specific variables
Variable Description
n[1] Number of loaded data sets ( now writable)
n[2]* Maximum allowed number of data sets
nx[<ik>]* Number of points in x-direction for data set <ik>
ny[<ik>]* Number of points in y-direction for data set <ik>
ni[<ik>]* Type of data set <ik>. (0 for 1D and 1 for 2D data)
np[<ik>]* Number of points of 1D data set <ik>
xmin[<ik>]* Minimum x-value of data set <ik>
xmax[<ik>]* Maximum x-value of data set <ik>
ymin[<ik>]* Minimum y-value of data set <ik>
ymax[<ik>]* Maximum y-value of data set <ik>
zmin[<ik>]* Minimum z-value of data set <ik>
zmax[<ik>]* Maximum z-value of data set <ik>
x[<ik>,<ip>] X-value of data point <ip> of data set <ik>
y[<ik>,<ip>] Y-value of data point <ip> of data set <ik>
dx[<ik>,<ip>] Value of $\sigma_{x}$ for data point <ip> of data set <ik>
dy[<ik>,<ip>] Value of $\sigma_{y}$ for data point <ip> of data set <ik>
z[<ik>,<ix>,<iy>] Z-value of point <ix>,<iy> of data set <ik>
cmap[<ic>,3] Colour map entry in R,G,B (0..1) for colour <ic>
cmap[1]* Number of bitmap colours available
p[<i>] Fit variable number <i> (see section 8)

Another variable is res[i] which contains the results of a particular KUPLOT command. The variable res[0] contains the number of elements returned in res[i]. Check the online help for the different commands to see what results might be returned in this variable.


next up previous contents
Next: 6.2 Arithmetic expressions Up: 6. FORTRAN style interpreter Previous: 6. FORTRAN style interpreter
Thomas Proffen {Billinge}
1999-06-26