Assignment - POSINT Pseudovariable

Purpose

Assigns an integer value to specified storage.

Syntax

POSINT(expression1[,position[,length]]) = expression2

Parameters

expression1
A reference to connected storage; expression1 cannot be an array, structure, or named constant.
position
A positive integer value specifying the position of the first bit in the field.
length
A positive integer value in the range 0 – 32 specifying the length of the field.
expression2
Any expression that evaluates to an integer.

Description

The POSINT pseudovariable assigns an integer value to specified storage. expression2 is converted to Fixed Bin(31). The internal representation of the resulting integer value is then assigned to the storage specified by the arguments to POSINT

If position is specified, its minimum value is 1 and its maximum value is the length in bits of the storage specified by expression1. If position is omitted, the default value is 1.

If length is specified, its minimum value is 0 and its maximum value is the length in bits of the storage specified by expression1, less the value of position. If length is omitted, the default value is equal to the number of bits from the bit indicated by position to the end of the storage specified by expression1.

POSINT and INT are identical pseudovariables, except that INT assigns a signed integer.

The result of this pseudovariable is dependent on the native byte ordering of the hardware you are using. For this reason, the use of this function may not be portable across different platforms.

Restrictions

None.