can be replaced by if Event1_OT_Hour is a byteif Event1_OT_Hour >23 then Event1_OT_Hour = 23
if Event1_OT_Hour <1 then Event1_OT_Hour = 0
saves heaps of typing if nothing elseEvent1_OT_Hour=Event1_OT_Hour min 23
can be replaced by if Event1_OT_Hour is a byteif Event1_OT_Hour >23 then Event1_OT_Hour = 23
if Event1_OT_Hour <1 then Event1_OT_Hour = 0
saves heaps of typing if nothing elseEvent1_OT_Hour=Event1_OT_Hour min 23
has anyone a way to use 2 word value varables to accumulate an math value with out using longs or floating point
Hi,
Depends on your particular needs, here's one way to be used when the value to be added fits within a WORD:
If the value to be added is always one then:Code:HW VAR WORD LW VAR WORD Temp VAR WORD AddValue VAR WORD Temp = LW ' Copy low word LW = LW + AddValue IF LW < Temp THEN ' Low word wrapped around HW = HW + 1 ENDIF/Henrik.Code:HW VAR WORD LW VAR WORD LW = LW + 1 IF LW = 0 THEN 'Low word wrapped around. HW = HW + 1 ENDIF
Why you don't try N-Bit_MATH?
http://www.picbasic.co.uk/forum/show...2694#post82694
I use this code to store result as string in array
Code:'Convert 64Bit to string @ MOVE?CP 10, _Tmp64bit ; copy a CONSTANT to a Pvar FOR i=19 TO 0 STEP -1 @ MATH_DIV _Int64Bit, _Tmp64bit, _Res64bit ; Res = A / B; Remainder in REG_Z ValueStr[i]=REG_Z+48 @ MOVE?PP _Res64bit, _Int64Bit ; copy a Pvar to a Pvar NEXT i
Bookmarks