I have a simple sort macro...
DEF FN swap(arr, xp, yp) = \
temp = arr(xp)\
arr(xp) = arr(yp)\
arr(yp) = temp
DEF FN sort(arr, n) = \
FOR i = 0 TO n - 1\
FOR j = 0 TO n - i - 1\
IF arr(j) > arr(j+1) THEN\
swap(arr, j, j+1)\
END IF\
NEXT j\
NEXT i
This compiles fine, no errors or warnings. However, when I call it with an array with integers...
sort(myArray, length)
' ...rest of code
I get a strange error complaining about the following statement thereafter, after the macro has been invoked.
If I comment out the sort call, I'm back with a clean compilation.