473,503 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6686
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14983
by: Fieldmedic | last post by:
I'm trying to determine the best way to randomize a set of array items. I'm thinking that I could use an arraylist and have it use the lower and upper bounds as the limits. Any suggestions? ...
3
14609
by: Gaffer | last post by:
Hello Is there a way in which I can make certain parts of Html on my website random so that each viewer will see different material if they refresh the page or come back onto the website later?...
1
3413
by: Ellen Manning | last post by:
I've got an A2K database with a report that generates any number of random medical record numbers. The user inputs how many numbers they want and report uses the Randomizer function found on "The...
2
2465
by: Rich | last post by:
Here is what I am trying for randomizing 2 numbers in the same subroutine so that they are not equal to each other: Dim j As Integer, k As Integer j = New System.Random().Next(0, 10) k = New...
4
2207
by: Arnold | last post by:
Hi there, Here's the situation--there is a text field in a form in which students will key in data. On the keypress event, I'd like for different sounds to be played for each character typed,...
1
3744
by: Badass Scotsman | last post by:
Hello, This code is supposed to generate a random string each run, however I have had it live on a few sites, and it seems to create repeat strings all over the place. ...
6
2378
by: mrtaka79 | last post by:
Okay, first of all, I'm a complete noob, so go easy on me. I have this code that works perfectly for me. The only thing I want to add is to randomize the pictures/links that show up. Can anyone...
1
2136
by: VBSTUDENT | last post by:
I am just wondering if there is a way to randomize the aritmetic operators in code, I know how to randomize numbers but I am not sure if it is possible to randomize operators. Any help would be...
5
2871
by: gggram2000 | last post by:
Hi, I'ved spent two full days trying to find a solution, I can randomize numbers between two ranges and it works fine, But my problem is when i want to randomize five numbers that I got. eg. I...
0
7204
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.