468,296 Members | 1,306 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,296 developers. It's quick & easy.

randomize

Hello,
randomize is a function in vbscript.
What is the function for vb ?

(I have tried to use that command in the script in web-service of .net,
which used VB and not VBScript).

Thanks :)


Nov 20 '05 #1
4 6432
Have a look at the System.Random class. It provides better support for
random numbers than the classic VB functions.

If you want to keep using the classic functions, though, you can use
"Randomize."
"Mr. x" <a@b.com> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
Hello,
randomize is a function in vbscript.
What is the function for vb ?

(I have tried to use that command in the script in web-service of .net,
which used VB and not VBScript).

Thanks :)

Nov 20 '05 #2
"Mr. x" <a@b.com> schrieb
Hello,
randomize is a function in vbscript.
What is the function for vb ?

(I have tried to use that command in the script in web-service of
.net, which used VB and not VBScript).

Thanks :)


I don't know VBscript, but in VB.Net you can use

Microsoft.VisualBasic.VBMath.Randomize
There is also the System.Random class.
--
Armin

Nov 20 '05 #3
try this for vb6

dim d
d=rnd * 100
debug.print d
rnd will always return a float value between 0 and 1

"Mr. x" <a@b.com> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
Hello,
randomize is a function in vbscript.
What is the function for vb ?

(I have tried to use that command in the script in web-service of .net,
which used VB and not VBScript).

Thanks :)

Nov 20 '05 #4
Hello,

"Mr. x" <a@b.com> schrieb:
randomize is a function in vbscript.
What is the function for vb ?

(I have tried to use that command in the script in
web-service of .net, which used VB and not VBScript).


'Randomize' won't return a pseudo-random number in VBScript. You have to
use 'Rnd' to generate the number.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fieldmedic | last post: by
3 posts views Thread by Gaffer | last post: by
1 post views Thread by Ellen Manning | last post: by
1 post views Thread by Badass Scotsman | last post: by
6 posts views Thread by mrtaka79 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.