Return to Snippet

Revision: 29150
at July 23, 2010 05:00 by brandonio21


Initial Code
Private sub random() 'Creates the sub
dim textbox as new textbox 'Makes a new textbox to store data
textbox.text = Int(Rnd() * 2) 'Tells the program to put the random thing inside of the textbox
 Select Case textbox.text 'Starts the case block
  Case 0 '1st case define
    textbox.text = "lol" 'Whats inside of case 0
  Case 1 '2nd case define
    textbox.text = "lawl" 'Whats inside of case 1
 End Select 'End the case block
msgbox(textbox.text) 'Puts the random variable in a message box
End sub 'Ends the sub

Initial URL
http://brandonsoft.com

Initial Description
This code can be used to make random items from a list of specified items.

Initial Title
Using CASES to generate random items

Initial Tags

                                

Initial Language
VB.NET