HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

HPCIGETVAR

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM callable only.

Retrieves a valid variable name from the session-level variable table and returns the current value and/or attributes.

Syntax

                CA     I32    U32V    *

   HPCIGETVAR(varname,status[,itemnum,item] [...])
NOTE: You can specify up to six itemnum/item pairs.

Parameters

varname

character array (required)

Passes the name of a session-level variable whose value is to be retrieved. The name must begin with either an alphabetic character or the underscore character. It must consist of alphanumeric or underscore characters. The name is delimited by a nonalphanumeric, nonunderscore character, and can be up to 255 characters long. The name is not case-sensitive.

status

32-bit signed integer by reference (optional)

Returns the status of the HPCIGETVAR call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpreted as two 16-bit fields.

Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Refer to the MPE/iX Error Message Manual Volumes 1, 2 and 3 (32650-90066, 32650-90152, and 32650-90368) for a description of its value.

Bits (16:16) comprise status.subsys. The value represents the subsystem that set the status information. The subsystem identifier for HPCIGETVAR is 166.

itemnum

32-bit unsigned integer by value (optional)

Passes a number indicating the item, refer to Table 4-15 “HPCIGETVAR Itemnum/Item Values”.

item

type varies (optional)

Returns variable information as specified in itemnum, refer to Table 4-15 “HPCIGETVAR Itemnum/Item Values”.

NOTE: If the type of variable is unknown, pass the maximum number of itemnum,item pairs (6) and check itemnum 13 (variable type) to determine which item holds the variable's value.

Table 4-15 HPCIGETVAR Itemnum/Item Values

ItemnumMnemonicItem Description
0 Itemnum/item pair ignored
1I32

Integer value of variable (output):

0 if variable is not an integer.

Default: No value returned

2CA

String value of variable (output):

An ASCII 0 is returned if the value of the variable is not a string.

Default: No value returned

3I32

Boolean value of variable (output):

1 for a true value, 0 for a false value, 0 if variable is not a boolean.

Default: No value returned

10I32

Length of array passed to hold variable's string value (input):

If a length is passed and an array is not, an error occurs.

Default: 255

11I32

Actual length (in bytes) of variable's string value (output)

Default: No value returned

12I32

Recursion used (input):

Nonzero if the variable is to be recursively dereferenced; zero if the variable should not be recursively dereferenced (that is, it should retain its level one value).

Default: 1 (nonzero)

13I32

Type of variable (varname, if found) (output) :

The variable found returns the following:

1

Integer

2

String

3

Boolean

Default: No value returned

 

NOTE: For itemnum=12, recursively dereferenced variables are always returned as string values.

Related Information

Intrinsics

HPCIPUTVAR, HPCIDELETEVAR

Commands

DELETEVAR, SETVAR, SHOWVAR

Manuals

Command Interpreter Access and Variables Programmer's Guide (32650-90011) and MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364)

Feedback to webmaster