I use bit set with a byte variable for the bit number without issue
Tmp_1 = DBuf(DigN)
Tmp_1.Seg_n = SEGon ' ok
But when I use a var with NOT to toggle the bit I get an error.
Temp_1.Seg_n=!Temp_1.Seg_n'< Error: SysTemp1 is not a bit or valid constant
I used a workaround to keep going (If statement) ,
Issue test code below...
'Toggle bit Test#chip 12F683, 8#config Osc = IntSeg_n=7Temp_1=255'Toggle disp buffer array bitTemp_1.7=!Temp_1.7'OKTemp_1.Seg_n=!Temp_1.Seg_n'< Error: SysTemp1 is not a bit or valid constantIfTemp_1.Seg_n=1thenTemp_1.Seg_n=0ElseTemp_1.Seg_n=1'< WorkaroundEnd
I use bit set with a byte variable for the bit number without issue
Tmp_1 = DBuf(DigN)
Tmp_1.Seg_n = SEGon ' ok
But when I use a var with NOT to toggle the bit I get an error.
I used a workaround to keep going (If statement) ,
Issue test code below...
Great Cow BASIC (0.98.07 2021-07-07 (Windows 64 bit) : Build 995)
Compiling D:\Data_GCBasic\TEST1_OEM_Lib\BitToggleTst_1.GCB ...
An error has been found:
BitToggleTst_1.GCB (12): Error: SysTemp1 is not a bit or valid constant.
Constant values should be 0 or 1
The message has been logged to the file Errors.txt.
Test code attached...
Last edit: ToniG 2022-06-28
Another workaround is similar to the bit set for an array.
Dim TmpBit as Bit
TmpBit = Temp_1.Seg_n : TmpBit = !TmpBit : Temp_1.Seg_n = TmpBit '< Workaround 2