Code: Select all
; perform SWAP
LAB_SWAP
JSR LAB_GVAR ; get var1 address
STA Lvarpl ; save var1 address low byte
STY Lvarph ; save var1 address high byte
LDA Dtypef ; get data type flag, $FF=string, $00=numeric
PHA ; save data type flag
JSR LAB_1C01 ; scan for "," , else do syntax error then warm start
JSR LAB_GVAR ; get var2 address (pointer in Cvaral/h)
PLA ; pull var1 data type flag
EOR Dtypef ; compare with var2 data type
; BUGFIX: SWAP would only swap a string with a number otherwise it would generate an error!
;
; BPL SwapErr ; exit if not both the same type
BNE SwapErr ; exit if not both the same type
;
; End of bugfix.