Yes, there is a confusion between assignment and equality.
This fixes it:
return (a == b)
FUNCTION CMPR(STRING »a, STRING »b) AS INT
STRING a = »a
STRING b = »b
IF (a=b) THEN
print "equal 1"
ELSE
print "different 1"
END IF
int c=(a==b)
print c
return (a == b)
'function = (a == b)
END FUNCTION
STRING su
STRING sa
su = "compare3"
sa = "compare3"
IF CMPR(su, sa) THEN
print "equal 2"
ELSE
print "different 2"
END IF
You can see the difference more clearly here:
'assignments vs logical expressions
int a,b,c,d
c=2
d=2
a=(c=d)
b=(c==d)
print a ", " b