
Basically, Select and case are like "If" and "End If's" however you dont need as many, it can cut the coding down alot which is fab.
So now heres an example of coding. Sorry for it not being Halo related, I'm not too sure how you would make it Halo related, anyways.
Open up Visual Basic 6, and create a new Standart Exe.
In this you won't need any objects on the form, its ALL coding. You can use other ways to do a few things, like hidding the form but I like to show it in coding, so it helps you.
Double click the Form, so it comes upto the Form_Load section. This is where the coding will be!

Firstly you need to Dim the type of data you will be using, this also makes the coding shorter keeping the file size down too.
Code: Select all
Dim Age As Single
**Additional piece of code**
Code: Select all
Form1.Visible = False
****
Next we will be creating an input box so you can input the data. When we Declared that Age was a single it also made the computer rememer what you input.
Code: Select all
Age = InputBox("How old are you?", "Age Test")
Select Case Age
Code: Select all
Case Is >=18
***For this please press the Tab key in visual basic, this will now indent the coding properly, so the coding is within the "Case" command, basically it means "Case" is like brackets, and the indent is just another line.
Code: Select all
MsgBox "You are old enough to drive!"
Code: Select all
Case 17
Code: Select all
MsgBox "You can drive next year!"
Just displays a messege box
Code: Select all
Case Else
Code: Select all
MsgBox "You are too young to drive"
Code: Select all
End Select
Code: Select all
Unload Me
Here is the coding from my program
Code: Select all
Private Sub Form_Load()
Dim Age As Single
Form1.Visible = False
Age = InputBox("How old are you?", "Age Test")
Select Case Age
Case Is >= 18
MsgBox "You are old enough to drive!"
Case 17
MsgBox "You can drive next year!"
Case Else
MsgBox "You are too young to drive"
End Select
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim Msg, Style, Title, Response, MyString
Msg = "Are you sure you want to terminate this program