HPlogo MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions (ABORTSESS - FCLOSE)

BINARY

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Converts a numeric (octal or decimal) ASCII string to a 16-bit twos complement binary value.

Syntax



  I16               CA        I16V
  bineqv := BINARY (asciieqv, length);

Functional Return


bineqv

16-bit signed integer (assigned functional return)

Passes the twos complement binary equivalent of the numeric string.

Parameters


asciieqv

character array (required)

Passes the octal or signed-decimal number (in ASCII characters) to be converted. If the character string begins with a percent sign (%), it is treated as an octal value. If the character string begins with a dollar sign ($), it is treated as a hexadecimal value. In this case, the string must be less than 6 characters and only 0 through 9, a through f, and A through F are allowed. The maximum hex strings are $ffff and $7fff. If the character string begins with a plus sign, a minus sign, or a number, it is treated as a decimal value. Leading blanks are not allowed and are treated as illegal characters.

length

16-bit signed integer by value (required)

Passes the length (number of bytes) of the ASCII-coded value. If the value of length is 0, the intrinsic returns 0 to the calling process. When the value of length is negative, the intrinsic causes the process to abort.

Condition Codes


CCE (2)Request granted. A 16-bit binary value is returned to the process.
CCG (0)Request denied. A word overflow, possibly resulting from too many characters (asciieqv number too large), occurred in the value returned.
CCL (1)Request denied. An illegal character was encountered in asciieqv. For example, the digits 8 or 9 were specified in an octal value.

Related Information


ASCII, CTRANSLATE, DASCII, DBINARY, HPFPCONVERT
Manuals Data Types Conversion Programmer's Guide




BEGINLOG


CALENDAR