HTBasic Help
×
Menu
Index

STATUS

Returns control information from an interface or I/O path.
 
 STATUS source [,register] ;variable [,variable...]
STATUS( source, register )
STATUS @widgethandle;RETURN(return attribute list)
 
Usage:
STATUS CRT;Col,Row
STATUS @Io,1;Type
IF STATUS(CRT,6) THEN ALPHA OFF
PRINT "Baud rate is ";STATUS(9,3)
STATUS 1801,19;Gains(*)
STATUS @Field1;RETURN ("VALUE":Limit$)
STATUS @Input;RETURN ("VALUE":Setpoint)
STATUS @Meter1;RETURN ("LOW LIMIT":Low_lim,
"HIGH LIMIT":High_lim)
 
Example: STATUS.BAS
 
Description:
The I/O path or interface register contents are copied into the numeric variables, starting at the specified register number and continuing until the variable list is exhausted. The default register number is zero.
The range of legal registers and the meaning of values read from them differ for each interface. The Users Guide describes the CONTROL and STATUS registers for each interface and for I/O paths. Typically, registers return integer values and if you specify real values, they are rounded to integers. However, some drivers return real values or even arrays, so the documentation should be consulted.
 
The function form of STATUS complements the STATUS statement. It allows immediate access to a single register without need for a temporary variable or separate STATUS statement. However, the STATUS function can only return one value at a time, while the STATUS statement can return multiple registers in a single statement.
 
Each widget has a variety of attributes that control its appearance and behavior. The STATUS statement is used to query the value of a widget attribute. The widget must have been created previously using an ASSIGN statement. Attributes are either scalar (may contain a single value) or vector (may be assigned an array of values) and have values of either numeric or string type.
 
A shorthand method is available that permits you to query values of several attributes without naming them individually on the STATUS statement. (Only scalar attributes may be queried with this shorthand method.)
You store all the attributes in a string array and supply an array
to receive attribute values.
Then, when you supply the array names to the STATUS statement, the value of each attribute named in each element of the attribute array will be returned in the corresponding element of
the value array.
Elements of the attribute array that contain nothing, or nothing but blanks, will be ignored and the corresponding element of the value array will remain unchanged.
 
Since widget handles are equivalent to I/O path names, you may use the STATUS statement to query the value of registers, which provide information about the widget. For widgets, Status Register 0 and Status Register 1 are defined.
 
Status Register 0 is defined for all I/O paths. For example:
 
STATUS @Io_path,0;Numeric_var
 
For widgets, this returns a 5 to numeric_var (5 means @Io_path is a widget). Status Register 1 is defined for all I/O paths assigned to a device. For example:
 
STATUS @Pb_12,1;Numeric_var
 
For widgets, this will return a 6 to numeric_var (6 means @Pb_12 is a device associated with the internal graphics CRT).
 
Any status register greater than 1 will cause Error 155 - Bad interface register number. Using ENTER, OUTPUT, TRANSFER, etc., (all other commands associated with I/O paths assigned to devices) generates Error 170 - I/O operation not allowed.
 
BackPorting to HP BASIC:
STATUS @Iopath,2 always returns a 4. STATUS @File,3 returns the current length, not the CREATE length. This is because files are extendable Windows.
 
The STATUS() function is an addition to HTBasic. Any STATUS or CONTROL registers greater than 99 are also additions. As in HP BASIC, STATUS register 0 of interface cards contains the card ID. Interface cards that are available on a PC, but not on an HP BASIC Workstation are identified with ID numbers greater than or equal to 300. These new features should not be used in programs that must be ported back to HP BASIC.
See Also: