[ANSYS, Inc. Logo] return to home search
next up previous contents index

3.6.1 Defining a Scheme Variable in the Text Interface

To define a scheme variable named pres_av/thread-id in the text interface, you can use the scheme command:

 
      (rp-var-define 'pres_av/thread-id 2 'integer #f)

Before you define a scheme variable, it is often good practice to check that the variable is not already defined. You can do this by typing the following command in the text window:

 
  (if (not (rp-var-object 'pres_av/thread-id))
      (rp-var-define 'pres_av/thread-id 2 'integer #f))

This command first checks that the variable pres_av/thread-id is not already defined, and then sets it up as an integer with an initial value of $2$.

Note that the string '/' is allowed in Scheme variable names (as in pres_av/thread-id), and is a useful way to organize variables so that they do not interfere with each other.


next up previous contents index Previous: 3.6 Scheme Macros
Up: 3.6 Scheme Macros
Next: 3.6.2 Accessing a Scheme
Release 12.0 © ANSYS, Inc. 2009-01-14