Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: seed random()
Is there any way to seed random() so it doesn't return the same value every time it is first called?
TimeDelay(1)before the Random.
Random is "auto-seeded" with the number of clock ticks since windows has started.
If it is in your startup group, it may be getting the same number of clock ticks on each invocation, resulting in the same random number.
TimeDelay(1) will wait till the next clock second has passed - which will be a varying number of real clock ticks, and this ought to result in better random numbers.
RDM=random(99)RDM results in a range from 0-99. (one and two digits). Maybe I'm using the wrong function?
RDM=10+Random(89)
The temporary file name will have the form:
preXXXX.tmp
Where "pre" is the prefix specified by the user, and "XXXX" is a 4-character hexadecimal string generated to guarantee a unique file name. The file name will have an extension of ".tmp".
for i=1 to 20 a=49+Random(8) TimeDelay(0.25) Message("",a) next
list="red green brown black purple yellow magenta" count=ItemCount(list, " ") while 1 rand=Random(count -1 ) + 1 color=ItemExtract(rand,list, " ") Pause(rand,color) endwhile
Article ID: W13099
Filename: Random() Function.txt
File Created: 2001:01:12:10:51:36
Last Updated: 2001:01:12:10:51:36