Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MOD() - looks like a bug
Message
From
24/02/2002 00:31:35
 
 
To
20/02/2002 12:30:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00621577
Message ID:
00624215
Views:
37
>I can't reproduce. I'd go with a simplier routine :
>
>rand(-1)
>create cursor randvals (rnd b(2))
>for ix=1 to 1000
>   insert into randvals values (round(CertainRand(2,8),0))
>endfor
>locate
>brow
>* random values
>* E.g. between -2147483647 and +2147483647 (int datatype range)
>function CertainRand
>lParameter nLowerLimit, nUpperLimit
>DO CASE
>CASE nLowerLimit>nUpperLimit
>	RETURN null
>CASE nLowerLimit=nUpperLimit
>	RETURN nLowerLimit
>otherwise
>	return rand()*(nUpperlimit-nLowerLimit)+nLowerLimit
>ENDCASE
>
Cetin

Got the idea.
Thank you.
Kamil.
A moment of silence is our cosmic reset button.
Previous
Reply
Map
View

Click here to load this message in the networking platform