-
Jan 22nd, 2018, 05:42 PM
#41
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Yes it is that line.. I put in the username and passords and it keeps telling me that each of them arent declared
-
Jan 22nd, 2018, 05:45 PM
#42
Re: Please Help!! Im on a deadline and I cant figure this out!!
What about the word "exactly" don't you understand??? If you can't write it then post the actual error. Also post the actual line of code.
-
Jan 22nd, 2018, 05:49 PM
#43
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Is it is the Login(txtUsername.Text, txtPassword.Text) line? What is the exact error?
Yes it is that line. Okay lets just get this straight..I was supposed to pretty much subsitute that line with the usernames and passwords right??
Well when I did it says that each of those arent declared
-
Jan 22nd, 2018, 05:51 PM
#44
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by wes4dbt
What about the word "exactly" don't you understand??? If you can't write it then post the actual error. Also post the actual line of code.
Why dont you come of this thread like the other guy IS THAT EXACT ENOUGH!!!!!
-
Jan 22nd, 2018, 06:00 PM
#45
Re: Please Help!! Im on a deadline and I cant figure this out!!
No, you don't substitute that line with the usernames and passwords.
Since it's never been clear, I'm assuming your program asks the user to enter their username into a textbox and a password into a different textbox. What are the names of those textboxes?
Assuming the names are txtUsername and txtPassword, respectively, then the line of code should be EXACTLY:
Code:
Login(txtUsername.Text, txtPassword.Text)
That calls the Login Sub in your module and passes the values typed in to the Username and Password textboxes to the Sub.
-
Jan 22nd, 2018, 06:01 PM
#46
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
Why dont you come of this thread like the other guy IS THAT EXACT ENOUGH!!!!!
Not really, don't understand what your saying. But I'm more than happy to leave this thread.
-
Jan 22nd, 2018, 06:03 PM
#47
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Yes thats correct.. The name of the username box is txtusername and the name of the password box is txtpassword
-
Jan 22nd, 2018, 06:04 PM
#48
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
No, you don't substitute that line with the usernames and passwords.
Since it's never been clear, I'm assuming your program asks the user to enter their username into a textbox and a password into a different textbox. What are the names of those textboxes?
Assuming the names are txtUsername and txtPassword, respectively, then the line of code should be EXACTLY:
Code:
Login(txtUsername.Text, txtPassword.Text)
That calls the Login Sub in your module and passes the values typed in to the Username and Password textboxes to the Sub.
Yes thats correct.. The name of the username box is txtusername and the name of the password box is txtpassword
-
Jan 22nd, 2018, 06:05 PM
#49
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
Yes thats correct.. The name of the username box is txtusername and the name of the password box is txtpassword
ok so I put in(txtUsername.Text, txtPassword.Text) back on there..is that all that i need to do for the loginform?
-
Jan 22nd, 2018, 06:07 PM
#50
Re: Please Help!! Im on a deadline and I cant figure this out!!
Does it look like this now?
Code:
Public Class LoginForm
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles lblUsername.Click, btnLogin.Click
Login(txtUsername.Text, txtPassword.text)
If Main.blnLoggedIn Then
MessageBox.Show(“Thank you for logging in, “ & txtUsername.Text, “Logged In.”)
Me.Close()
End If
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Application.Exit()
End Sub
End Class
-
Jan 22nd, 2018, 06:07 PM
#51
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
Yes thats correct.. The name of the username box is txtusername and the name of the password box is txtpassword
ok so all i have to figure out is how to get the function return statement...Everything I try to put keeps saying return statement is missing from all code paths
-
Jan 22nd, 2018, 06:08 PM
#52
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Does it look like this now?
Code:
Public Class LoginForm
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles lblUsername.Click, btnLogin.Click
Login(txtUsername.Text, txtPassword.text)
If Main.blnLoggedIn Then
MessageBox.Show(“Thank you for logging in, “ & txtUsername.Text, “Logged In.”)
Me.Close()
End If
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Application.Exit()
End Sub
End Class
yes it does thankyou
-
Jan 22nd, 2018, 06:08 PM
#53
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
ok so all i have to figure out is how to get the function return statement...Everything I try to put keeps saying return statement is missing from all code paths
Just put:
in both VerifyUsername and VerifyPassword just to get past those errors, and see if your program will run and process a username and password properly, which it should at this point
-
Jan 22nd, 2018, 06:12 PM
#54
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Just put:
in both VerifyUsername and VerifyPassword just to get past those errors, and see if your program will run and process a username and password properly, which it should at this point
I already have this on the function part
Code:
Function VerifyUsername(username As String) As Boolean
'If the username is found, Return True, otherwise Return False
End Function
Function VerifyPassword(password As String) As Boolean
'If the passwords match, Return True, otherwise Return False
End Function
and it still has the errors??
-
Jan 22nd, 2018, 06:13 PM
#55
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Just put:
in both VerifyUsername and VerifyPassword just to get past those errors, and see if your program will run and process a username and password properly, which it should at this point
Code:
I already have this on the function part
Code:
Function VerifyUsername(username As String) As Boolean
Return True
'If the username is found, Return True, otherwise Return False
End Function
Function VerifyPassword(password As String) As Boolean
Return true
'If the passwords match, Return True, otherwise Return False
End Function
Do I have to make it look like this?
-
Jan 22nd, 2018, 06:14 PM
#56
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
I already have this on the function part
Code:
Function VerifyUsername(username As String) As Boolean
'If the username is found, Return True, otherwise Return False
Return True
End Function
Function VerifyPassword(password As String) As Boolean
'If the passwords match, Return True, otherwise Return False
Return True
End Function
and it still has the errors??
The words after the single quote, those are just comments, like an in-program post-it note to the programmer. They don't actually do anything. Add the bold lines.
-
Jan 22nd, 2018, 06:17 PM
#57
Re: Please Help!! Im on a deadline and I cant figure this out!!
You really are One rude member. OptionBase1 is not exactly helping with poor examples. I don't think I have ever met a new member with such disregard to this forum.
-
Jan 22nd, 2018, 06:19 PM
#58
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
The words after the single quote, those are just comments, like an in-program post-it note to the programmer. They don't actually do anything. Add the bold lines.
Ahhhh IT WORKED!!!! OMG THANKYOU SO MUCH I REALLY APPRECIATE IT!!!
-
Jan 22nd, 2018, 06:22 PM
#59
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by ident
You really are One rude member. OptionBase1 is not exactly helping with poor examples. I don't think I have ever met a new member with such disregard to this forum.
Poor examples? I was basing my assistance directly on the code posted by the user. In a case like this, I'm not going to provide code at a level that I would use were it me writing the program, that doesn't accomplish anything other than copy/paste and nothing is learned. I was providing assistance that was in-line with the posters abilities, in my opinion.
-
Jan 22nd, 2018, 06:22 PM
#60
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by ident
You really are One rude member. OptionBase1 is not exactly helping with poor examples. I don't think I have ever met a new member with such disregard to this forum.
What are you talking about?? I wasnt rude to any of you guys until you started treating me like that first!! I said this was the first time I ever used this program and your acting like im already supposed to know how everything is supposed to be!! What is this forum for if you cant get help!! OPTIONBASE is the only one who actually helped me!! Dont be mad because im showing respect where its due!!
-
Jan 22nd, 2018, 06:24 PM
#61
Re: Please Help!! Im on a deadline and I cant figure this out!!
-
Jan 22nd, 2018, 06:26 PM
#62
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Poor examples? I was basing my assistance directly on the code posted by the user. In a case like this, I'm not going to provide code at a level that I would use were it me writing the program, that doesn't accomplish anything other than copy/paste and nothing is learned. I was providing assistance that was in-line with the posters abilities, in my opinion.
Dont listen to that comment hes just mad thats hes the poor example on this thread!! Hes the one coming at people rude and trying to blame someone else. SORRY NOT SORRY!! You helped me based on my skill level and now I understand how to make it work!! Thank you again!
-
Jan 22nd, 2018, 06:50 PM
#63
Re: Please Help!! Im on a deadline and I cant figure this out!!
You'd likely find this site a useful reference. It's one we often recommend when starting out:
https://www.homeandlearn.co.uk/NET/vbNet_video.html
Whatever course you are in is not giving you much of a foundation in coding based on some of the questions you've asked. That's not all that unusual around here. I'd say that it reflects poorly on the state of teaching of programming languages, but it's not safe to say that. After all, if your teacher was doing a great job, would you even be here? Therefore, those people who come here may be coming from less quality courses. On the other hand, it really comes down to whether you want to learn programming, or not, and that's not something you likely know when you are starting out. Many of us, like myself, never took a course in computers of any sort, so we only learned at whatever pace and in whatever way we wanted to. When you are in a class, you go at the pace of the class....and in the direction the class takes you, which may not be great.
As I said before, debugging is a skill I think should be covered second (right after data types), yet it is often completely ignored, as it was for your class. On the other hand, we get questions ranging from "nobody knows the answer" to super easy. It's often hard to know how to answer because we don't know what lever the person is coming from, especially when it is a question from class work. Is it a good class? Did it cover X? Always hard to say.
My usual boring signature: Nothing
-
Jan 23rd, 2018, 02:18 AM
#64
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
Did you read the first post in this thread? The directions provided in the first post specifically state to use arrays. How exactly do think putting the data in a ListView solves anything here? All your post will do is confuse the poster even more since the code you posted accomplishes exactly 0 towards the end goal of the program.
well your a real sunshine...
what does this do then (I highlighted it Blue, just for the sunshines of this world)
Code:
Public Sub lvwAddItem(ByVal lvw As ListView, ByVal ParamArray Text() As String)
With lvw.Items
.Add(New ListViewItem(Text))
End With
End Sub
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Jan 23rd, 2018, 05:23 AM
#65
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by ChrisE
well your a real sunshine...
what does this do then (I highlighted it Blue, just for the sunshines of this world)
Code:
Public Sub lvwAddItem(ByVal lvw As ListView, ByVal ParamArray Text() As String)
With lvw.Items
.Add(New ListViewItem(Text))
End With
End Sub
regards
Chris
I would be happy to apologize profusely to you if you can point out any post that suggests that using a ListView accomplishes anything regarding the problem posted.
-
Jan 23rd, 2018, 10:55 AM
#66
Re: Please Help!! Im on a deadline and I cant figure this out!!
You two bickering and sniping isn't really helping anyone. I can't figure out what actually happened in the thread because of it.
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Jan 23rd, 2018, 11:14 AM
#67
Re: Please Help!! Im on a deadline and I cant figure this out!!
Or anyone else bickering and sniping in this thread.
My usual boring signature: Nothing
-
Jan 23rd, 2018, 03:46 PM
#68
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by Shaggy Hiker
You'd likely find this site a useful reference. It's one we often recommend when starting out:
https://www.homeandlearn.co.uk/NET/vbNet_video.html
Whatever course you are in is not giving you much of a foundation in coding based on some of the questions you've asked. That's not all that unusual around here. I'd say that it reflects poorly on the state of teaching of programming languages, but it's not safe to say that. After all, if your teacher was doing a great job, would you even be here? Therefore, those people who come here may be coming from less quality courses. On the other hand, it really comes down to whether you want to learn programming, or not, and that's not something you likely know when you are starting out. Many of us, like myself, never took a course in computers of any sort, so we only learned at whatever pace and in whatever way we wanted to. When you are in a class, you go at the pace of the class....and in the direction the class takes you, which may not be great.
As I said before, debugging is a skill I think should be covered second (right after data types), yet it is often completely ignored, as it was for your class. On the other hand, we get questions ranging from "nobody knows the answer" to super easy. It's often hard to know how to answer because we don't know what lever the person is coming from, especially when it is a question from class work. Is it a good class? Did it cover X? Always hard to say.
Yea Im getting my Bachelors in business management and Visual Basic is one of my electives. So I pretty much got thrown into it plus its online course so I really have to figure it out on my own
-
Jan 23rd, 2018, 04:02 PM
#69
Re: Please Help!! Im on a deadline and I cant figure this out!!
Oh yeah, "X for Non-X Majors", that's not a category that serves the best for anybody, no matter what X is.
I got thinking about the question, after I wrote that. I can honestly say that I have no idea how I learned to program. I have NO memory of learning any part of it. No light bulb moments. No dawning of comprehension. Nothing like that at all. I started when I was pretty young, and must have learned the basics of methods, loops, conditional statements, and variables. I then didn't do any more for a few years, then spent a few months in HS working on a program with some friends, till it started killing my grades, at which point we all stopped. I don't know why I thought I could do that, but I must have felt good enough about programming to undertake writing a program, cause I wasn't learning coding at that time. I then didn't touch it again until after grad school, when I needed to do something for a job....and now it IS my job.
So, as far as my memory is concerned, I never learned it, I just always knew it. That certainly can't be right, but just as certainly makes it harder for me to answer certain types of questions. I don't remember not knowing. However, I do remember not knowing RegEx, and JavaScript (though that is still just programming), so I would say that a tutorial to have at hand is useful. I don't advocate learning any language from just one source. When I was learning C++, I had two books (no internet). One was a good, general, instruction book, while the other was also pretty good, but not quite AS good. However, both presented the same things in different ways. So, I'd read it in one book, then read it in the other book, and the different flavors would blend to create a better understanding than either one was able to do on its own.
My usual boring signature: Nothing
-
Jan 23rd, 2018, 05:25 PM
#70
Re: Please Help!! Im on a deadline and I cant figure this out!!
I could argue expecting someone to show proficiency in programming in one semester is foolhardy.
Everything in programming builds on something else. Starting with a language like LOGO is probably "best", because it gets the student used to thinking in terms of telling the computer discrete statements, one at a time, and seeing how small changes can result in complex new behavior.
LOGO doesn't have a concept of variables, if I recall. That's a good next step, but I don't know a language that just has simple statements and variables. If you know variables you usually learn flow control along with it: only While loops and If statements are necessary, but For loops are a good syntax sugar as well. This is about the level of TI-BASIC, which is actually the first language I ever used.
From there, arrays are their own topic. What they are. How they're used. Their relationship with loops. How to add, how to insert, how to remove. Sorting. Shuffling. None of this makes sense without all of the other topics. All of it is required to have anything approaching proficiency.
What next, methods? It's hard to write a program all in one method. Arguably you should learn them before arrays, but arrays being a variable-like thing makes this questionable. Return values. Parameters. We can't talk about ByRef yet, but there it is.
After methods, classes. And I guess structs. Somehow we have to talk about inheritance, polymorphism, sneak in interfaces... it's hard to talk about methods before these but methods make no sense without them? That's why non-OO languages like Pascal seem like good stepping stones. (Incidentally, that was my second language.)
Now you need events. They're sort of fancy methods, so it's not a big discussion.
Then, FINALLY, you have the information you need to start doing meaningful things with Windows Forms.
This is very much like math subjects. Starting with a VB WinForms project is like starting a mathematics class with Trig identities, saying, "Just roll with this, you'll learn it all later." If you've got the touch, sure, you'll probably work it all out. I don't think most of these "Programming for <major that needs 1 elective>" courses should assume they're talking to prodigal programmers.
I taught myself programming. My first contact was maybe in 1998. I don't think I wrote a significant program until 2000 or so. I certainly didn't finish any projects until then. It is a long, slow, laborious process. Faster now, due to the internet and better languages, but still not something you can cram.
But VB is "the easy language" so they just buy a curriculum and tell the students to do it, because they care about as much for the students' well-being as the students care about being VB developers. You can't do squat in VB until you've made it through half a book's content. LOGO takes 1 page for a kid to start poking and speculating and trying new things.
Niche, focused topics would make a heck of a lot more sense for business major programming. Excel formulas. Excel VBA. Python financial libraries. These are things that represent an edge. "Making a vending machine in VB .NET" is not the way to show them this will be an important skill.
Last edited by Sitten Spynne; Jan 23rd, 2018 at 05:37 PM.
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Jan 23rd, 2018, 05:42 PM
#71
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
This was just one step to my project thats going to be graded. I have 4 more to go so Im hoping I can get through them okay. Im not very good at this I will admit
-
Jan 25th, 2018, 03:56 PM
#72
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by OptionBase1
I'm glad it works.
Well now Im super confused.. My instructor returned my assignment without grading it..He said:
Thank you for your recent project submission. Unfortunately, I cannot grade your work at this time because you did not code the VerifyUsername and VerifyPassword Functions properly in your program.
I dont know what to do at this point..the program works so how else am i supposed to code that?
-
Jan 25th, 2018, 04:10 PM
#73
Re: Please Help!! Im on a deadline and I cant figure this out!!
Help me out a little because this thread got a little muddied.
- What is your actual assignment?
- What, if any, is the exact example code that came with it?
- What is the exact code you submitted?
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Jan 25th, 2018, 04:13 PM
#74
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Last edited by EmilyM1105; Jan 25th, 2018 at 04:18 PM.
-
Jan 25th, 2018, 04:14 PM
#75
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by Sitten Spynne
Help me out a little because this thread got a little muddied.
- What is your actual assignment?
- What, if any, is the exact example code that came with it?
- What is the exact code you submitted?
My exact assignment is the very first post on this thread
-
Jan 25th, 2018, 04:20 PM
#76
Thread Starter
Addicted Member
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by Sitten Spynne
Help me out a little because this thread got a little muddied.
- What is your actual assignment?
- What, if any, is the exact example code that came with it?
- What is the exact code you submitted?
It looks different then it originally did on this thread because Ive moved on to a different part of the assignment now..My only issue at this point is that my instructor returned it without grading because he said that my functions arent coded properly..The program works so im not sure how else to code it
-
Jan 25th, 2018, 05:01 PM
#77
Re: Please Help!! Im on a deadline and I cant figure this out!!
Originally Posted by EmilyM1105
Well now Im super confused.. My instructor returned my assignment without grading it..He said:
Thank you for your recent project submission. Unfortunately, I cannot grade your work at this time because you did not code the VerifyUsername and VerifyPassword Functions properly in your program.
I dont know what to do at this point..the program works so how else am i supposed to code that?
I pointed this out in two separate posts:
Originally Posted by OptionBase1
You have defined the two functions listed above, but your code to actually check the username and the password is in the Login Sub.
Originally Posted by OptionBase1
Your code was close enough to demonstrate that you know most of what you are intended to do. You still don't have any of the code for checking the username and password inside of the actual VerifyUsername and VerifyPassword functions, and you're never calling the Login method, which I and others pointed out.
If you make the bolded changes below your program should work, but you likely won't get full credit due to not implementing the specified functions completely.
There are many ways to get a program to produce the correct results, but not all of them are "right" when you are given strict guidelines as to how your program should be written. Your instructor is right. You disappeared for several days and then came back pretty worked up about a deadline, so helping you get your code to work as you had coded it was really the only option at that point. I'll make a follow-up post in a second.
-
Jan 25th, 2018, 05:06 PM
#78
Re: Please Help!! Im on a deadline and I cant figure this out!!
In your original post
Using what you know about search arrays, implement the VerifyUsername and VerifyPassword functions. They should return true if the username or password is found in the arrUsernames or arrPasswords array, respectively.
Your code doesn't do that, all your functions do is Return True.
Code:
Function VerifyUsername(username As String) As Boolean
'If the username is found, Return True, otherwise Return False
Return True
End Function
Function VerifyPassword(password As String) As Boolean
'If the passwords match, Return True, otherwise Return False
Return True
End Function
You put the code for verifying the UserName and Password in the LogIn procedure.
Thank you for your recent project submission. Unfortunately, I cannot grade your work at this time because you did not code the VerifyUsername and VerifyPassword Functions properly in your program.
It seem your instructor wants you to move your verification code to those functions.
-
Jan 25th, 2018, 05:13 PM
#79
Re: Please Help!! Im on a deadline and I cant figure this out!!
So, the intent is that you delegate the checking of the username to the VerifyUsername function, and the checking of the password to the VerifyPassword function. Right now, those functions are doing nothing.
You said you are in Business Management, so I'll try to relate what a Sub is and what a Function is to running a Business.
Imagine you are a manager, and you delegate a task to an employee, like "Go clean out the fridge". That is analogous to a Sub. A small task of code that you can just call on to get done whenever it is needed. In fact, you have a Sub in your code right now, the Login Sub.
Now, imagine you have an employee, and you tell them "Can you print me a sales report from last quarter?" That is analogous to a Function. What is the difference? Well, in this case, you've asked an employee to do something AND give you something in return. If your employee comes back with a Coffee for you, then I'm assuming you would see there would be a problem. So a Function needs to Return a result, and it needs to be the expected type of result.
Now, in your case, you've been asked to delegate the Login process to a subordinate (the Login Sub), and are told that you need to tell your subordinate to delegate the actual verification of the username and the password to two of their subordinates (the VerifyUsername and VerifyPassword functions).
What you've coded is that you've delegated the Login process to a subordinate (the Login Sub), and that subordinate is asking two subordinates if they have time do something, they both say Yes, but then your subordinate (the Login Sub) does the checking of the Username and Password itself.
Does that make sense?
-
Jan 25th, 2018, 05:19 PM
#80
Re: Please Help!! Im on a deadline and I cant figure this out!!
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. The "As Boolean" at the end of the Funcion declaration means that the function will return a Boolean value, so it has to return True or False.
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).
Last edited by OptionBase1; Jan 25th, 2018 at 05:25 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
|