BIN$() OCT$() HEX$()

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
BIN$( number [, chars])
OCT$( number [, chars])
HEX$( number [, chars])
BASE$( base, number [, chars])

Description:

BIN$( number [, chars])
Returns a string giving the binary (base 2) value for the 'number'. 
'chars' is optional and specifies the number of characters in the string with zero as the leading padding character(s).

OCT$( number [, chars])
Returns a string giving the octal (base 8) representation of 'number'. 
'chars' is optional and specifies the number of characters in the string with zero as the leading padding character(s).

HEX$( number [, chars])
Returns a string giving the hexadecimal (base 16) value for the 'number'. 
'chars' is optional and specifies the number of characters in the string with zero as the leading padding character(s).

BASE$( base, number [, chars]) CMM2 and H7 only
Returns a string giving the base value for the 'number'.
'chars' is optional and specifies the number of characters in the string with zero as the leading padding character(s). base can be between 2 and 36. 
Numbers >9 are represented by a letter as per hex.

PRINT BIN$(12345678,32)
PRINT OCT$(12345678,16)
PRINT HEX$(12345678,8)
END


output:
00000000101111000110000101001110
0000000057060516
00BC614E



Last edited: 08 May, 2021