|
-
Jan 22nd, 2007, 02:25 PM
#1
Thread Starter
Member
Re: New to VB 6! Can't code this program.. :(
 Originally Posted by MarkT
See if this gets you going in the right direction
VB Code:
Option Explicit
Dim strGuests(4) As String
Private Sub Command1_Click()
Dim blnValid As Boolean
Dim strInput As String
Dim i As Integer
Do
'Get the name
strInput = LCase(InputBox("Who are you?"))
'Check if the name is in the array
For i = 0 To 4
If LCase(strGuests(i)) = strInput Then
blnValid = True
Exit For
End If
Next i
'Loop while a valid name has not been entered
Loop While Not blnValid
MsgBox "valid name"
End Sub
Private Sub Form_Load()
strGuests(0) = "Vert"
strGuests(1) = "dclamp"
strGuests(2) = "vntalk"
strGuests(3) = "si_the_geek"
strGuests(4) = "MarkT"
End Sub
That helps a lot! Thanks!
I think this will be enough to start me off.
Last edited by vert; Jan 22nd, 2007 at 03:13 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|