LIBCONVERT-INMOS(3)

NAME
BOOLTOSTRING, HEX16TOSTRING, HEX32TOSTRING, HEX64TOSTIRNG, HEXTOSTRING, INT16TOSTRING, INT32TOSTRING, INT64TOSTRING, INTTOSTRING, REAL32TOSTRING, REAL64TOSTRING, STRINGTOBOOL, STRINGTOHEX, STRINGTOHEX16, STRINGTOHEX32, STRINGTOHEX64, STRINGTOINT, STRINGTOINT16, STRINGTOINT32, STRINGTOINT64, STRINGTOREAL32, STRINGTOREAL64 - KRoC INMOS occam toolset type conversion library

SYNOPSIS
#USE "convert.lib"
kroc -lconvert

PROC BOOLTOSTRING (INT len, []BYTE string, VAL BOOL b)
PROC HEX16TOSTRING (INT len, []BYTE string, VAL INT16 n)
PROC HEX32TOSTRING (INT len, []BYTE string, VAL INT32 n)
PROC HEX64TOSTRING (INT len, []BYTE string, VAL INT64 n)
PROC HEXTOSTRING (INT len, []BYTE string, VAL INT n)
PROC INT16TOSTRING (INT len, []BYTE string, VAL INT16 n)
PROC INT32TOSTRING (INT len, []BYTE string, VAL INT32 n)
PROC INT64TOSTRING (INT len, []BYTE string, VAL INT64 n)
PROC INTTOSTRING (INT len, []BYTE string, VAL INT n)
PROC REAL32TOSTRING (INT len, []BYTE string, VAL REAL32 X, VAL INT Ip, VAL INT Dp)
PROC REAL64TOSTRING (INT len, []BYTE string, VAL REAL64 X, VAL INT Ip, VAL INT Dp)

PROC STRINGTOBOOL (BOOL Error, BOOL b, VAL []BYTE string)
PROC STRINGTOHEX (BOOL Error, INT n, VAL []BYTE string)
PROC STRINGTOHEX16 (BOOL Error, INT16 n, VAL []BYTE string)
PROC STRINGTOHEX32 (BOOL Error, INT32 n, VAL []BYTE string)
PROC STRINGTOHEX64 (BOOL Error, INT64 n, VAL []BYTE string)
PROC STRINGTOINT (BOOL Error, INT n, VAL []BYTE string)
PROC STRINGTOINT16 (BOOL Error, INT16 n, VAL []BYTE string)
PROC STRINGTOINT32 (BOOL Error, INT32 n, VAL []BYTE string)
PROC STRINGTOINT64 (BOOL Error, INT64 n, VAL []BYTE string)
PROC STRINGTOREAL32 (BOOL Error, REAL32 X, VAL []BYTE string)
PROC STRINGTOREAL64 (BOOL Error, REAL64 X, VAL []BYTE string)

SUMMARY
The occam toolset library convert.lib provides conversion procedures that format data types into strings and parse strings to give the data types.

TO-STRING CONVERSION
Format the given data type into the string possibly padding with spaces to a given field width or printing Ip integer places and Dp decimal places for REAL32 and REAL64 types. Hex numbers are written with leading zeros. len is returns the length of the formatted data.

FROM-STRING CONVERSION
Convert the given string to the data type. If Error is TRUE then the conversion failed. No '#' or lower case letters are allowed for hex numbers.

SEE ALSO
kroc(1)
INMOS occam 2 toolset user manual - part 2 (occam libraries and appendices) INMOS document number 72 TDS 276 02.

AUTHOR
This document is Copyright (C) 1993 David Beckett, University of Kent at Canterbury. This manual page is maintained by Fred Barnes <frmb@kent.ac.uk>

The library contents are Copyright (C) 1991 INMOS Limited.