forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Random function not working

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Thu Jun 09, 2011 10:40 am    Post subject: Random function not working Reply with quote

Hi All

I have a script which has been compiled to a Novell file server. It contains
Code:

%%random1 = @random(1,7)

I use this for load balancing the running of parts of the script by users.
The problem is the @random function is not working and is always generating 6.
Anyone know why this is happening?

Thanks

David...
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Thu Jun 09, 2011 11:33 am    Post subject: Reply with quote

You need to seed the random function.

Code:

RANDOM @datetime(shn)

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Fri Jun 10, 2011 10:57 am    Post subject: Reply with quote

Yes seeding fixed the problem. Do you know why the @random() function
locked up? The compiled script is on a Novell server but is run over the
network on each PC.

Thanks

David

BTW. I used
Code:
@datetime(sn)@mod(@sysinfo(freemem),100)

for the seed just to be different.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group