HPlogo MPE/iX Intrinsics Reference Manual > Chapter 7 Command Definitions (HP32208-HPLOACNMPROC)

HPCIPUTVAR

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

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 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 7-6 "HPCIPUTVAR Itemnum/Item Values".

item

type varies by reference (optional)

Passes the variable information specified in itemnum. Refer to Table 7-6 "HPCIPUTVAR Itemnum/Item Values".

Table 7-6 HPCIPUTVAR Itemnum/Item Values

Itemnun Mnemonic Item Description
0Itemnum/item pair ignored
1I32Integer 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.
2CAString 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.
3I32The 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.
11I32VActual length of value string assigned to variable name (input):

Itemnum/item pair 11 must be passed whenever itemnum2 is passed.
14I32String 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 7-7 HPCIPUTVAR itemnum 14 with item values

Value of item Value of var_value Type/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 FINDJCW, GETJCW, PUTJCW, SETJCW, HPCIDELETEVAR, HPCIGETVAR
CommandsDELETEVAR, SETJCW, SETVAR, SHOWJCW, SHOWVAR
Manuals Command Interpreter Access and Variables Programmer's Guide
MPE/iX Commands Reference Manual




HPCIGETVAR


HPDATECONVERT