UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

The following table lists conversion codes to be used with ICONV to convert from other numbering systems to decimal value or ASCII character. ICONV conversions into other numbering systems produce multiple characters in the target numbering system: 1-357 UniBasic Commands Reference Hexadecimal – One ASCII character produces two hexadecimal characters. For example, ASCII character “0” is equal to hexadecimal “30”. Octal – One ASCII character produces three octal characters. For example, ASCII character “0” is equal to octal “060”. Binary – One ASCII character produces eight binary characters. For example, ASCII character “0” is equal to octal “00110000”. Examples From To Function Binary Decimal value ICONV MB Binary ASCII character ICONV MB0C Octal Decimal value ICONV MO Octal ASCII character ICONV MO0C Hexadecimal Decimal value ICONV MX Hexadecimal ASCII character ICONV MX0C ICONV HEX ICONV Options for Converting from Alternate Numbering Systems The following table demonstrates some ICONV MO, MX, and MB conversion codes and their results. Input Code Result 123123 MO 42579 (decimal) 123123 (octal) MO0C SS (ASCII characters) Examples of Numbering System Conversions

Related Commands UniBasic Input Code Result 100 (hexadecimal) MX 256 (decimal) 101010101010 (binary) MB 170 (decimal) 4B (hexadecimal) MX 75 (ASCII characters) Examples of Numbering System Conversions (continued) CHAR; OCONV Hex (MX | HEX), Octal (MO), Binary (MB); SEQ ICONV Hex (MX | HEX), Octal (MO), Binary (MB) 1-358

The following table lists conversion codes to be used with ICONV to convert from<br />

other numbering systems to decimal value or ASCII character.<br />

ICONV conversions into other numbering systems produce multiple characters in the<br />

target numbering system:<br />

1-357 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

Hexadecimal – One ASCII character produces two hexadecimal characters.<br />

For example, ASCII character “0” is equal to hexadecimal “30”.<br />

Octal – One ASCII character produces three octal characters. For example,<br />

ASCII character “0” is equal to octal “060”.<br />

Binary – One ASCII character produces eight binary characters. For<br />

example, ASCII character “0” is equal to octal “00110000”.<br />

Examples<br />

From To Function<br />

Binary Decimal value ICONV MB<br />

Binary ASCII character ICONV MB0C<br />

Octal Decimal value ICONV MO<br />

Octal ASCII character ICONV MO0C<br />

Hexadecimal Decimal value ICONV MX<br />

Hexadecimal ASCII character ICONV MX0C<br />

ICONV HEX<br />

ICONV Options for Converting from Alternate Numbering Systems<br />

The following table demonstrates some ICONV MO, MX, and MB conversion codes<br />

and their results.<br />

Input Code Result<br />

123123 MO 42579 (decimal)<br />

123123 (octal) MO0C SS (ASCII characters)<br />

Examples of Numbering System Conversions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!