10 16 1 BinaryString Conversions

LANSA Technical

10.16.1 BinaryString Conversions

A hexadecimal string cannot be represented in a numeric type, so the Binary String primitive is used as a staging area for the conversion.

Integers can be converted to and from hexadecimal strings by using the following intrinsics:

Given an integer, convert to binary string using #integerValue.AsBinaryString(),

Convert the binary string to a hexadecimal representation using #binaryString.AsHexString(),

Given a binary string containing a hexadecimal value, access as an integer value using #binaryString.AsHexToInt().

These methods work with both integers and long integers.

For example:

Define Field(#myRBStr) Type(*BIN) Length(128) Define Field(#L8Int) Type(*INT) Length(8) #myRBStr := (9999).AsBinString()
#myRBStr.AsHexString() gives 0F270000
#L8Int := 169999999999
L8Int.AsBinString().AsHexString() gives FF23CA9427000000 on intel-based computers.
 

Ý 10.16 Integer Intrinsic Functions