It would be nice with a random function where you could specify max and min. It also would be nice if you could use float as a parameter or you could specify what type you want in return.
For example...
Result.f = Random(0.4, 1.2)
or
Result.w = Random(600, 800)
I'm sure someone else must have come with the same request here before...
[Implemented] Random with max, min and type
-
- Addict
- Posts: 1126
- Joined: Wed Oct 15, 2003 12:40 am
- Location: Sweden
- Contact:
[Implemented] Random with max, min and type

(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Hi
In the meantime you can use this:
MFG
WolfgangS
In the meantime you can use this:
Code: Select all
hans.f=Random(8)/10+0.4
Debug hans.f
Debug SizeOf(hans)
sepp.w=Random(200)+600
Debug sepp.w
Debug SizeOf(sepp)
WolfgangS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
-
- Addict
- Posts: 1126
- Joined: Wed Oct 15, 2003 12:40 am
- Location: Sweden
- Contact:
Yes - thanks... It's just what I'm doing right now... But if you want very small number it is a lot of typing. For example... If you want a random number between 0.006 and 0.008.WolfgangS wrote:Hi
In the meantime you can use this:MFGCode: Select all
hans.f=Random(8)/10+0.4 Debug hans.f Debug SizeOf(hans) sepp.w=Random(200)+600 Debug sepp.w Debug SizeOf(sepp)
WolfgangS
Code: Select all
Debug ((Random(1000) *0.002)/1000 + 0.006)

(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Have you considered to write a function for ittechjunkie wrote:
Yes - thanks... It's just what I'm doing right now... But if you want very small number it is a lot of typing. For example... If you want a random number between 0.006 and 0.008.
Code: Select all
Debug ((Random(1000) *0.002)/1000 + 0.006)

guido
-
- Addict
- Posts: 1126
- Joined: Wed Oct 15, 2003 12:40 am
- Location: Sweden
- Contact: