Hello Charles, im trying to overcome the fact that i cannot place comparisons directly as the parameter of a function. For example, this is not allowed by Oxygen:
function isequal(int *c) as long
return c
end function
print isequal("a" = "b")
Using this is allowed though:
print isequal(("a" = "b"))
But then it creates the same issue (when using functions) that I explain next. The problem is in the following code:
function something(string s) as string
return "I exist!"
end function
MACRO testbyte int(r, v b)
int b = (v)
'code to determine the value of r goes here.
r = b
END MACRO
print testbyte(something("a") = "A")
Complains like this:
ERROR: Linker found unidentified names:
1074 something "main source
What i understand is that it does not recognize something as a valid function name... but it IS valid.
If i change the macro like this:
MACRO testbyte int(r, v)
r = v
END MACRO
I expect the macro to place a false or true value in r, depending on the result of a comparison, but instead i get this compile-time error:
ERROR: ERROR: parameters mismatch for procedure something
params given : #string#string@00
OPTIONS:
something(string) returns string
WORD: "A"
LINE: 1072
FILE: "main source
It seems to "think" i passed two strings as parameters of something (kind of like a class property method), when in fact i just tried to compare them.
Changing the macro like this:
MACRO testbyte int(r, v)
r = (v)
END MACRO
Goes back to:
ERROR: Linker found unidentified names:
1072 something "main source