Labels & numerics

Status
Not open for further replies.

riv503ca

New Member
Hi All! When writing programs with the OSHONSOFT Basic Compiler
what are the rules governing LABELs ?

What are the rules governing numerics and ASCII characters?
For example do we use $55 or 0x055 for hex? Binary #s? Decimal #s?

There is not much in the reference manual on these subjects.
 
hi,
Is this the info that you are asking for.?

Code:
Const pi = 314
Const beta = 123

Dim abit As Bit
Dim abyte As Byte
Dim aword As Word   
Dim arry(5) As Byte

abit = 0
abit = 1
abit = 0x01
abit = %1
abit = %0
abit = 1h
abit = True
abit = False

''abyte = &13  'not allowed
''abyte =.13  'not allowed
''abyte = #13'not allowed

abyte = %00010011  'binary notation
abyte = 13h  'hex notation
abyte = 0x13  'hex notation
abyte = 13  'decimal
abyte = arry(0)
abyte = beta  'constant

aword = %0000000000010011  'binary notation
aword = 1213h  'hex notation
aword = 0x1213  'hex notation
aword = 1213  'decimal
aword = arry(0)
aword = pi  'constant
 
Last edited:
Good afternoon, Mr. Gibbs,
Thank you for the info.
As to LABELs:
How many chars are allowed (label length)?
What Chars are not allowed?
Also, is $55 a correct hex format?

W Harris Riverside, CA
 
Good afternoon, Mr. Gibbs,
Thank you for the info.
As to LABELs:
How many chars are allowed (label length)?
What Chars are not allowed?
Also, is $55 a correct hex format?

W Harris Riverside, CA

hi,
$55 is allowed, it represents 55hex.

I will look thru the documentation to check regarding chars and length.

EDIT:
The max label length is 32 characters.
I would suggest that you write a simple Basic program and try the 'characters' that you would like to use, in order to check their acceptance.
If you do, please post your results.

Code:
Dim a1234567890123456789012345678901 As Byte  'the 32 len appears to be the limit

dummy:
a1234567890123456789012345678901 = 13h
Goto dummy

End
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…