Determine the errors in the given form.

Dim scholar As Student

Private Sub btnGo_Click(...) Handles btnGo.Click
   DIm firstName as String
   scholar.Name = "Warren"
   firstName = scholar.Name
End Sub
kivakhimeraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
Is Student a Class or a Structure?

What would you need to differently with your "scholar" variable given those two choices above?
0
kivakhimeraAuthor Commented:
Honestly, I am extremely lost on this, that is why I am reaching out to an expert for help. In this scenario I have declared scholar and an object of the type "Student." If this is the case, then does my error lie in that I have not created an instance of the type "Student?"  Would I need to use a statement such as scholar = New Student (),  to clarify before I can utilize a statement such as scholar.name = "Warren" so that I have assigned a value to the name Warren?
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
You are right that the crux to this problem is the "New" keyword.

If Student is a CLASS, then yes, you will need to instantiate an instance with the "New" keyword.

If Student is a STRUCTURE then you do not need to use the "New" keyword.

So there may or may not be an "error" in that code, depending on how Student was designed.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kivakhimeraAuthor Commented:
Thanks! This was a great help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.