how to genarate a random numbers in vb?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What if you do not specify anything when you call a procedure?

540


who will create the object?

1722


What are the environments supported by vbscript language?

508


Can u describe what kind of testing are for OTC derivates by banks.

1670


what is the features of visual basic?

1556






Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

1852


Description.Create

2162


What is the use of the recordset object and which statement is used to create such an object?

531


Mention what is vbscript procedures?

542


What are the naming conventions while declaring a variable in the vbscript language?

621


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

1742


Does VB/Win make standalone .EXE files?

2903


1. How do declare public variable in vb scripts?

1579


1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

3557


Mention what is the main difference between function and sub-procedure?

553