I've found the bug, and will deal with it when I'm back home with access to FreeBASIC.
Are you sure that that code works anyway? GCBASIC uses this order of operations:
* / %
+ -
= <> < > <= >=
And, Or, Xor, Not
So your code is (or should be) translated into something like this:
SysTemp = 0x09 >= 5 ;should result in 255 but instead gives -1 due to the bug
SysIfTemp = DecTemp And SysTemp
if SysIfTemp.0 on then ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Quite positive it compiled, and it "seemed" to work O.K. Not going back to the old, so will take heed of the maths order. Grouped the statements like so, and now it compiles, Thanks!
If (DecTemp And 0x09) >= 5 Then
DecTemp = DecTemp + 5
End if
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This statement used to compile with GCBasic, but when upgraded to one of the latest Zip files, it doesn't.
If DecTemp And 0x09 >= 5 Then 'Round up hundredths to tenths
DecTemp = DecTemp + 5
End if
And the error message:
---------- Capture Output ----------
> "C:\Program Files\GCBasic\Compile.bat" C:\PROGRA~1\CRIMSO~1\I2C\DS1721~1
Great Cow BASIC (0.9 4/8/2007)
Compiling C:\PROGRA~1\CRIMSO~1\I2C\DS1721~1 ...
An error has been found:
DS1721~1 (103): Error: Missing operand, after &
The message has been logged to the file C:\PROGRA~1\GCBASIC\ERRORS.txt.
Press any key to continue
I've found the bug, and will deal with it when I'm back home with access to FreeBASIC.
Are you sure that that code works anyway? GCBASIC uses this order of operations:
* / %
+ -
= <> < > <= >=
And, Or, Xor, Not
So your code is (or should be) translated into something like this:
SysTemp = 0x09 >= 5 ;should result in 255 but instead gives -1 due to the bug
SysIfTemp = DecTemp And SysTemp
if SysIfTemp.0 on then ...
Quite positive it compiled, and it "seemed" to work O.K. Not going back to the old, so will take heed of the maths order. Grouped the statements like so, and now it compiles, Thanks!
If (DecTemp And 0x09) >= 5 Then
DecTemp = DecTemp + 5
End if