binary

Syntax binary (value)

Params value is the object you wish to coerce to be a binary datatype.

Action Coerces value to be a binary value.

Returns A binary representation of the data in value

Examples binary (23)

   » 0x00000017 // the binary representation of decimal 23

binary ('a')

   » 0x61 // ASCII value for the character "a"

binary ('abcd') // using a value of datatype str4

   » 0x61626364 // ASCII values for 'a' (61), 'b' (62), 'c' (63), 'd' (64)

binary ("What?")

   » 0x576861743F // binary value for the string

binary (true)

   » 0x0001 // binary value for the short integer "1," which is True in Frontier

binary (infinity)

   » 0x7FFFFFFF

Notes The binaryType of the binary value is set to typeOf (value).

See Also getBinaryType

setBinaryType

Discuss