Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MOD() - looks like a bug
Message
 
 
À
20/02/2002 12:30:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00621577
Message ID:
00624215
Vues:
35
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform