Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generating Random number
#1
Solved: 11 Years, 3 Months, 3 Weeks ago Wink 
Hello,
I am here with the hope of finding the syntax for generating the 10 digit random number to be stored in the global data sheet, so that it could be used some where else in the action. But next time when we run the same scrpt it should give other random number. I hope u understand.
Thanks for your help and time. Smile
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Use below Syntax.

Code:
iRandomValue = RandomNumber(1000000000,9999999999)

It will Generate a 10 Digit Random Value Exery time.

Other ways, you can write a Function with Length as Parameter which will Return a Random Value of your desired length.

The first one will be the easiest solution for you.

Hope this info will help you


Thanks

VENKATA
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
Randomize
Environment.Value("Client_No_Random")=Int((maxvalue - minvalue + 1) * Rnd) + minvalue

Randomize will make it to return a different number after every run ....

regards
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Thank you very much VenkatReddy garu and Chennai Kishore garu.... both of your ideas were very useful for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)