296
S:\HP8924C\USRGUIDE\BOOK\CHAPTERS\ibasic.fb
Chapter 6, IBASIC Controller
PROGram Subsystem
NOTE: If the variable name <var_name> is longer than 12 characters it must be sent as string data
(<var_name> enclosed in quotes). For example, OUTPUT 714;"PROG:STR
’Var_name’,’data’".
Attempting to send a <var_name> longer than 12 characters as character data
(<var_name> not enclosed in quotes) will generate the following error:HP-IB
Error: -112 Program mnemonic too long.
If the programmer wishes to append the IBASIC “$” string identifier onto the string
variable name, the string variable name must be sent as string data, that is enclosed in
quotes. For example,
OUTPUT 714;"PROG:STR 'Var_name$','data'"
Appending the IBASIC “$” string identifier onto the string variable name without
enclosing the string variable name in quotes will generate
HP-IB Error: -101 Invalid character.
If an attempt is made to set the value of a string variable or array and no IBASIC
program is in the Test Set an
IBASIC Error: -282 Illegal program name
is generated. If an attempt is made to set the value of a string variable or array and
the string variable specified in <varname> does not exist in the program an
IBASIC Error: -283 Illegal variable name is generated. If a quoted
string value is too long to fit into the string variable then it is silently truncated
when stored into the IBASIC string variable. If the specified string variable
cannot hold all of the quoted strings an
IBASIC Error: -108 Parameter
not allowed
is generated.
Syntax
PROGram[:SELected]:STRing <varname>{,<svalues>}
Example setting the value of a simple string variable
OUTPUT 714;"PROGram:SELected:STRing Variable,’data’"
or
OUTPUT 714;"PROG:STR Variable,’data’"
Example of setting the value of a string array with 3 elements of 5 characters each,
such as Array$(2)[5]
OUTPUT 714;"PROGram:SELected:STRing Array,’12345’,’12345’,’12345’"
or
OUTPUT 714;"PROG:STR Array,’12345’,’12345’,’12345’"
Note: With Option Base 0 set in IBASIC, array indexing starts at 0.