Oxygen Basic
Programming => Example Code => General => Topic started by: Arnold on April 08, 2015, 11:59:55 PM
-
Hi Charles,
is comparestr a valid function and can it be used only in assembler? I tried this code:
a="abc"
b="abc"
c="123"
print comparestr(a,b)
print comparestr(a,c)
I get some values, but I do not know what they mean. And everytime I run this snippet I get different values.
In the Oxygen help file there is listed xor=" as an operator. Is the quote necessary in some cases?
Roland
-
Hi Roland,
Yes, the quote mark looks like a typo. xor= works just like the other assignment operators
comparestr is the string comparator, and rarely used directly. It sets the CPU zero and sign flags.
a="abc"
b="abc"
c="123"
sys cm
comparestr(a,b)
(
jnz exit
print "equal"
jmp fwd ncompare
)
(
jg exit
print "less"
jmp fwd ncompare
)
(
jl exit
print "greater"
jmp fwd ncompare
)
.ncompare