VARNAME

Syntax: string = VARNAME(variable)

The VARNAME function accepts a variable, either string or numeric, as its argument, and converts that variable name into a string. This function can be useful in scripts where a variable is passed to the script as one of the generalized ? parameters. The variable name could then be converted to a string for display or manipulation.

Example

The following script shows one way in which the VARNAME function could be used.

 t1 = varname(?1) ! 1st variable name passed to the script converted to a string
 t2 = varname(?2) ! 2nd variable name passed to the script converted to a string
 graph ?1 ?2      ! plot graph of 2nd variable versus 1st variable
 text 'graph of '//t1//' vs '//t2 ! label the plot with the command