how to genarate a random numbers in vb?
Answers were Sorted based on User's Feedback
Answer / cnu
Function Random(max,min)
Randomize
Random=Int((max-min+1)*Rnd+min)
End Function
Dim A
A = random(100,1)
msgbox ("The random numer is:" &A)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / swamireddy
to genarate random numbers in vb using the random fuction
the fuction systax for
function Random(Lowerbound As Long, Upperbound As Long)
Randomize
Random = Int(Rnd * Upperbound) + Lowerbound
End Function
this fuction use automatically genarate a random numbers.
how to call the fuction.
a=random(lowerbound,upperbound)
| Is This Answer Correct ? | 0 Yes | 0 No |
Why to use option explicit in vb script?
Mention what are the rules to name variable in vbscript?
what is the function to display current date?
What are the different types of operators and their order of precedence?
how to organize files in object repository of qtp
How to capture a runtime error in vbscript?
Explain about operator precedence in vb script?
Explain How do you create a recordset object in vbscript?
How can you create a file object to work with the files in the vbscript language?
How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?
How will you get the octal value of the given number in vbscript?
Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)