I just upgraded to the newest version of Oxygen. The issue i was having before upgrading, still occurs in the newest version:
declare function rand lib "msvcrt.dll" alias "rand" () as int
declare function srand lib "msvcrt.dll" alias "srand" (int seed)
FUNCTION rnd(byval int l1, l2) AS DOUBLE
if l1 > l2 then
int l3 = l1
l1 = l2
l2 = l3
end if
double rv = (rand() / 32767)
return floor(l1 + (rv * (l2 - l1)))
END FUNCTION
srand(21123) ' seed the randomizer.
int v
int i
for i = 1 to 10
v = 2000 + rnd(1, 20) 'this fails. always returns a number smaller than 21
'v = rnd(1, 20) + 2000 'this works. this returns a number from 2001 to 2020.
print " r: " v chr(13, 10)
next i