473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 6676
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.