hi,
I'm trying to find out how the bintoascii function works and discovered a weird
thing while running the following lines of code:
the output gives
1 - 001
2 - 002
3 - 003
4 - 004
5 - 005
6 - 016
7 - 017
8 - 018
9 - 019
10 - 010
11 - 011
Does anyone know why from 6 until 9 the output gives 016 instead of 006
syntax of the bintoascii function:
I'm trying to find out how the bintoascii function works and discovered a weird
thing while running the following lines of code:
Code:
pause 500
serout 2, N2400_4, (254,1) 'Clear Screen
pause 30
main:
for b1 = 1 to 11
bintoascii b1,b2,b3,b4 ‘ convert b1 to ascii
serout 2, N2400_4, (254, 192, #b1, " - ", b2, b3, b4)
debug ‘ debug values for testing
next b1
goto main
1 - 001
2 - 002
3 - 003
4 - 004
5 - 005
6 - 016
7 - 017
8 - 018
9 - 019
10 - 010
11 - 011
Does anyone know why from 6 until 9 the output gives 016 instead of 006
syntax of the bintoascii function:
BINTOASCII variable, hundreds, tens, units
BINTOASCII wordvariable, tenthousands, thousands, hundreds, tens, units
- Variable contains the value (0-255) or wordvariable (0-65535)
- TenThousands receives the ASCII value (“0” to “9”
- Thousands receives the ASCII value (“0” to “9”
- Hundreds receives the ASCII value (“0” to “9”
- Tens receives the ASCII value (“0” to “9”
- Units receives the ASCII value (“0” to “9”
Last edited: