I dunno if someone has mentioned this before or not (I hope I'm not the first to bang my head against it anyways). btw, why is there no SEARCH function on this forum? How do you guys prevent people from asking the same stuff again and again???
Apparently the datatypes BYTE, WORD, and DWORD are broken (maybe others, didn't check). It looks to me that DBPro is using the wrong internal tmp variable for any expression involving these types. Also, if you use a smaller type like BYTE it will cast the result of the expression as a byte, even if the expression results in a number that is too big for a byte.
This was observed in DBPro with Patch 4 and the following code demonstrates the bug.
Var1 AS WORD
Var2 AS WORD
Var3 AS BYTE
Var1 = 1000
Var2 = 60000
Var3 = 120
IF Var1 >= Var2
PRINT "DBPRO thinks " + str$(Var1) + " >= " + str$(Var2) + " is TRUE."
ELSE
PRINT "DBPRO thinks " + str$(Var1) + " >= " + str$(Var2) + " is FALSE."
ENDIF
PRINT "DBPRO thinks " + str$(Var3) + " * 3 = " + str$(Var3 * 3)
SUSPEND FOR KEY