297
S:\HP8924C\USRGUIDE\BOOK\CHAPTERS\ibasic.fb
Chapter 6, IBASIC Controller
PROGram Subsystem
:STRing? <varname> The :STRing? query command is used to return, to an
external controller, the current value of string variables or arrays in an IBASIC
program in the Test Set . <varname> is the name of an existing string variable or
string array in the IBASIC program.
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’".
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$'"
Appending the IBASIC ‘$’ string identifier onto the string variable name without enclosing the
string variable name in quotes will generate the following error
HP-IB Error: -101 Invalid character
For simple string variables the value is returned as a quoted string (“This is an
example.”). For string arrays the values are returned as a comma separated list of
quoted strings (“This is an example.”,“This is an example.”). The string array
elements are returned in ascending order (Array$(0), Array$(1), Array$(2), etc.).
If an attempt is made to query the value of a string variable or array and no
IBASIC program is in the Test Set an
IBASIC Error: -283 Illegal
variable name
is generated. If an attempt is made to query 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.
Syntax
PROGram[:SELected]:STRing? <varname>
NOTE: The program commands and syntax used to enter string data from the Test Set into the external
controller will depend upon the programming language used in the external controller. The
examples which follow represent the capabilities of HP Rocky Mountain BASIC
programming language running on an HP 9000/300 Series Controller.