User`s manual

You cannot mix signed and unsigned data types in expressions with arithmetic or
logical operators. If you need to combine signed with unsigned, you will have to
use explicit conversion.
Example:
dim Sa as short
dim teA as byte
dim Bb as word
dim Sbb as integer
dim Scccc as longint
...
teA = teA + Sa
' compiler will report an error
teA = teA and Sa
' compiler will report an error
' But you can freely mix byte and word . .
Bb = Bb + (teA * teA)
' . . and short with integer and longint;
Scccc = Sbb * Sa + Scccc
You can assign signed to unsigned, or unsigned to signed only using the explicit
conversion. More details can be found in chapter Implicit Conversion and
Assignment Operator.
Sa = short(teA)
' this can be done
Sa = A
' this can't be done, compiler will report an error
Relation operators can be used with all data types, regardless of the sign.
Example:
if Sa > teA then
Sa = 0
end if
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
74
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
Rules for Creating Legal Expressions