I have the below IF statements tried on both VB6 and VB.net
Dim str As String = ""
If str = "," Or str = "," Or str = """" Then
'execute A
End If
When the str value is “,” (a full-width comma),
on VB6 A does not get executed while on VB.net it goes into the IF statement
and executes A.
The weird thing here is when I put this statement on watch when str = “,”,
「 str = “,” Or str = “,” Or str = “””” 」
it returns false, but still goes in the IF statement to execute A.
Does anyone has a clue to as to why this is happening?
I have tried changing from Or to orElse, and made sure the
Option Explicit On is there but its still the same result.
Im still new to VB.net so i might lack some foundation,
so any help is greatly appreciated.
Kuleh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.