|
-
Jan 25th, 2018, 05:24 PM
#11
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
 Originally Posted by OptionBase1
This is your code that actually checks to see if the entered username is found in the array:
Code:
Dim userIndex As Integer
For loopIndex = 0 To arrUsernames.Length - 1
If arrUsernames(loopIndex) = username Then
userIndex = loopIndex
Exit For
End If
Next
Essentially, that code should go inside the VerifyUsername function.
Code:
Function VerifyUsername(username As String) As Boolean
Dim userIndex As Integer
For loopIndex = 0 To arrUsernames.Length - 1
If arrUsernames(loopIndex) = username Then
userIndex = loopIndex
Exit For
End If
Next
End Function
But you are going to need to work through a couple issues:
1. Inside the Function you need to have some code that does a "Return True" if the username is found, and a "Return False" if the username isn't found. There are several was to write the logic to do this.
2. Your code to check for the password relies on knowing the value of userIndex. So you will have to do something with the userIndex variable to make it so that this value is accessible in both the VerifyUsername and VerifyPassword function (Hint: look at how blnLoggedIn is initialized).
So do I need to just delete it out of that area and copy and paste it in the function area. Or does it need to be in both places??
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
|