By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

randomize

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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.