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

HPCIPUTVAR

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM callable only.

Sets the value of a session-level variable.

Syntax

                CA     I32      U32V   *

   HPCIPUTVAR(varname,status[,itemnum,item] [...])
NOTE: Up to three itemnum/item pairs can be specified.

Parameters

varname

character array (required)

Passes the name of a session-level variable for which the value needs to be set. This name must begin with either an alphabetic character or the underscore character and consists of alphanumeric or underscore characters. The name is delimited by a nonalphanumeric, nonunderscore character, and must be <= 255 characters long. The name is not case-sensitive.

NOTE: It is not a good practice to define CI variables with the same names as JCW's (job control words). Defining CI variables with the same names as JCW's may cause unpredictable results.
status

32-bit signed integer by reference (required)

Returns the status of the HPCIPUTVAR 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 HPCIPUTVAR is 166.

itemnum

32-bit unsigned integer by value (optional)

Passes an item number indicating the item. Refer to Table 4-16 “HPCIPUTVAR Itemnum/Item Values”.

item

type varies by reference (optional)

Passes the variable information specified in itemnum. Refer to Table 4-16 “HPCIPUTVAR Itemnum/Item Values”.

Table 4-16 HPCIPUTVAR Itemnum/Item Values

ItemnunMnemonicItem Description
0 Itemnum/item pair ignored
1I32

Integer value assigned to specified variable name (input):

No other pairs are needed and, if specified, will cause an error. Default: Not considered an integer value.

2CA

String value assigned to specified variable name (input):

Default: Not a string variables.

Note: Requires itemnum 11. Itemnum 14 may be used with strings to set the type and value of varname.

3I32

The Boolean value to be assigned to the specified variable name (input).

Nonzero for a true value, zero for a false value.

Default: Not a boolean variable.

11I32V

Actual length of value string assigned to variable name (input):

Itemnum/item pair 11 must be passed whenever itemnum2 is passed.

14I32

String interpretation (strings only; may be used only with itemnum=2) (input).

If you specify itemnum=14, the value of its corresponding item defines the type-representation (and the value) of varname based upon an interpretation of the item paired with itenum=2. Refer to "Itemnum 14".

Default: 0 (zero).

 

Itemnum 14

Given the (Pascal) code fragment

   ...

   my_var := 'TESTVAR ';

   var_value := 'Hello world';

   val_len := 11;

   item := 0; { default }

   ...

   HPCIPUTVAR(my_var, status, 2, var_value, 

              11, val_len, 14, item)

The value of item will set the type (and value) of my_var based upon an interpretation of var_value:

Table 4-17 HPCIPUTVAR itemnum 14 with item values

Value of itemValue of var_valueType/Value of my_var
=0"TRUE"Boolean (TRUE)
 "FALSE"Boolean (FALSE)
 "123"Integer (123)
 "other chars"String ("other chars")
<>0"TRUE"String ("TRUE")
 "FALSE"String ("FALSE")
 "123"String ("123")
 "other chars"String ("other chars")

 

Operation Notes

Allows the value of a session-level variable to be set. The name must be a valid MPE/iX variable name. The variable's value can be either a 32-bit signed integer, an array of characters, or a boolean (TRUE/FALSE).

Related Information

Intrinsics

HPCIGETVAR, HPCIDELETEVAR

Commands

SETVAR, DELETEVAR, 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