If usernameInput == username And passwordInput == password Then
Me.Visible = False
End If
2 Replies - 431 Views - Last Post: 01 October 2012 - 09:57 PM
#1
Weird Error in not needed placed "Expression Expected"
Posted 01 October 2012 - 02:48 PM
Hi,I am a bit new to visual basic and I got the "Expression Expected" Error when I don't know why. Below is the line that I am getting the error.
Replies To: Weird Error in not needed placed "Expression Expected"
#2
Re: Weird Error in not needed placed "Expression Expected"
Posted 01 October 2012 - 03:09 PM
== ha no meaning in vb.net = is what you need.
Dim b = 1 = 3
First one is assignment, the second is a comparison (typically assuming that the operator has been overloaded)
Dim b = 1 = 3
First one is assignment, the second is a comparison (typically assuming that the operator has been overloaded)
This post has been edited by AdamSpeight2008: 01 October 2012 - 03:23 PM
#3
Re: Weird Error in not needed placed "Expression Expected"
Posted 01 October 2012 - 09:57 PM
In C# and most languages, = is an assignment operator and == is used for comparison.
In VB.NET, you use = for both.
Just as AdamSpeight2008 said, you just need to replace ==, to = and everything should work fine.
There are differences in operators for C# and VB.NET so you have to study them.
These are the basics. I might not have included all. You can do more research on them.
In VB.NET, you use = for both.
Just as AdamSpeight2008 said, you just need to replace ==, to = and everything should work fine.
There are differences in operators for C# and VB.NET so you have to study them.
' C# VB.NET Meaning ' != <> Not Equal To ' == = Equal To ' % Mod Modulus ' > > Greater Than ' < < Less Than ' >= >= Greater Than or Equal To ' <= <= Less Than or Equal To
These are the basics. I might not have included all. You can do more research on them.
This post has been edited by November-06: 01 October 2012 - 10:01 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|