Parallax BASIC Stamp 2e Programming Manual page 285

Table of Contents

Advertisement

Table 5.76: BS2, BS2e, BS2sx and
BS2p Conversion Formatters.
5: BASIC Stamp Command Reference – SERIN
Conversion
Type of Number
Formatter
Decimal, optionally limited to
DEC{1..5}
Signed decimal, optionally
SDEC{1..5}
limited to 1 – 5 digits
Hexadecimal, optionally limited
HEX{1..4}
to 1 – 4 digits
Signed hexadecimal, optionally
SHEX{1..4}
limited to 1 – 4 digits
Indicated hexadecimal,
IHEX{1..4}
optionally limited to 1 – 4 digits
Signed, indicated hexadecimal,
ISHEX{1..4}
optionally limited to 1 – 4 digits
Binary, optionally limited to
BIN{1..16}
1 – 16 digits
Signed binary, optionally limited
SBIN{1..16}
to 1 – 16 digits
Indicated binary, optionally
IBIN{1..16}
limited to 1 – 16 digits
Signed, indicated binary,
ISBIN{1..16}
optionally limited to 1 – 16 digits
1 All numeric conversions will continue to accept new data until receiving either the specified
number of digits (ex: three digits for DEC3) or a non-numeric character.
2 To be recognized as part of a number, the minus sign (-) must immediately precede a
numeric character. The minus sign character occurring in non-numeric text is ignored and
any character (including a space) between a minus and a number causes the minus to be
ignored.
3 The hexadecimal formatters are not case-sensitive; "a" through "f" means the same as "A"
through "F".
4 Indicated hexadecimal and binary formatters ignore all characters, even valid numerics,
until they receive the appropriate prefix ($ for hexadecimal, % for binary). The indicated
formatters can differentiate between text and hexadecimal (ex: ABC would be interpreted
by HEX as a number but IHEX would ignore it unless expressed as $ABC). Likewise, the
binary version can distinguish the decimal number 10 from the binary number %10. A
prefix occurring in non-numeric text is ignored, and any character (including a space)
between a prefix and a number causes the prefix to be ignored.
formatters require that the minus sign come before the prefix, as in -$1B45.
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 283
Numeric Characters Accepted
1 – 5 digits
-, 0 through 9, A through F
$, 0 through 9, A through F
-, $, 0 through 9, A through F
0 through 9
-, 0 through 9
0 through 9, A through F
0, 1
-, 0, 1
%, 0, 1
-, %, 0, 1
Indicated, signed
Notes
1
1,2
1,3
1,2,3
1,3,4
1,2,3,4
1
1,2
1,4
1,2,4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents