function fmt( double d, sys s ) as string
l = trunc d
r = frac d
string r2 = str(r)
if s = 0 then return str(l)
return str(l) + "." + mid( r2, 3, s )
end function
function fmt2( double d, sys s ) as string
double l = trunc d
double r = frac d
string r2 = str(r)
if s = 0 then return str(l)
return str(l) + "." + mid( r2, 3, s )
end function
print fmt(59.9876543210,0)
print fmt(59.9876543210,1)
print fmt(59.9876543210,2)
print fmt(59.9876543210,3)
print fmt(59.9876543210,4)
print fmt(59.9876543210,5)
print "okay"
print fmt2(59.9876543210,0)
print fmt2(59.9876543210,1)
print fmt2(59.9876543210,2)
print fmt2(59.9876543210,3)
print fmt2(59.9876543210,4)
print fmt2(59.9876543210,5)
print "okay"
% true =1
% false =0 'make this 0, and it doesn't work correctly
'as in other languages
'we need bool variables true 1, false 0
'so b = not(b) type code can be written
bool b = true
string crlf = chr(13) + chr(10)
string s = "b starts as true" + crlf + crlf
for x = 0 to 5
b = b != (b)
s += "x: " str(x) " bool: b= " str(b) crlf
next x
print s
bool b = false
string s = "b starts as false" + crlf + crlf
for x = 0 to 5
b = b not(b)
s += "x: " str(x) " bool: b= " str(b) crlf
next x
print s
mBox "Okay, Done"
% true =1
% false =0
bool a= true
mov eax,a
neg eax
not eax
mov a,eax
print "a= false " + a
mov eax,a
not eax
neg eax
mov a,eax
print "a= true " + a