function isequal(int *c) as long
return c
end function
print isequal("a" = "b")
print isequal(("a" = "b"))
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")
ERROR: Linker found unidentified names:
1074 something "main source
MACRO testbyte int(r, v)
r = v
END MACRO
ERROR: ERROR: parameters mismatch for procedure something
params given : #string#string@00
OPTIONS:
something(string) returns string
WORD: "A"
LINE: 1072
FILE: "main source
MACRO testbyte int(r, v)
r = (v)
END MACRO
ERROR: Linker found unidentified names:
1072 something "main source
MACRO testbyte int(r, v)
r = v
END MACRO
print testbyte((lcase("a") = "a"))
function testbyte (int v) as long
return v
END function
print testbyte((lcase("a") = "a"))
function testbyte (int v) as int
return v
end function
print testbyte( ( lcase("A") = "a") )
Horrible code!. Imagine someone trying to comprehend this code in a large script.
function drawcube(int color=0,int size=1)
print color " " size
end function
drawcube( size=2, color=0xff) '255 2
drawcube(size:2, color:0xff) '255 2
print iif(answer=correct, "YES", "NO")
drawcube(size:2, color:0xff) '255 2
John, this is the way some modern languages work. Have you tried swift?
CALL handleModules(DICTIONARY(), Index)
STDOUT BIT(var, 1)
BIT SET var, 1
udtmem AS BIT * 4 IN BYTE
'05:28 19/08/2020
'return type flexible using 'any'
macro ifs any(r,c,a,b)
if c
r=a
else
r=b
endif
end macro
string s=ifs(1=2, "yes", "no")
float r=ifs(1=2, 1.5, 2.5)
print s " " r
macro IIF& long(R,X,A,B)
if int(x)=0 then
r = b
else
r = a
end if
end macro
function iif(int c,a,b) as int
if c
return a
else
return b
endif
end function
print iif(1==2, 11, 10) '10
After removing the C-style ternary evaluator from te compiler, the boolean expressions seem to be working okay.