Got it working.
Changed code in Macro. Removed the local label called OverVar. Not sure why it was there anyway. Also took the gosub LcdGotoXY out of for/next loop since it only needed to be executed once.
Also put in provision in case the variable number = 0.
here's updated macro:
Code:
'PrintVar Macro
'Example: @ PrintVar x,y, _variableName
'
asm
PrintVar macro x, y, variable
MOVE?CB x, _posX
MOVE?CB y, _posY
MOVE?WW variable, _varData
L?CALL _VariableOut
endm
endasm
VariableOut:
zeroFlag = 0
gosub LcdGotoXY
'cycle through all possible digts of word sized number
for n = 4 to 0 step -1
lcdData = (varData dig n) + 48
if lcdData = 48 AND zeroFlag = 0 then SkipNum
zeroFlag = 1
gosub LcdSendChar
posX = posX + 6
SkipNum:
'if varData = 0 then print "0"
if n = 0 AND zeroFlag = 0 then
gosub LcdSendChar
endif
next
return
Bookmarks