Can you explain this strange logic?....
-
I have the following vb.net code :-
Dim bLogonResult As Boolean = Logon() If bLogonResult = True Then MessageBox.Show(bLogonResult) Else PDM.Common.ClientData.RestartApplication = False Me.Close() End If
Looks fairly straight-forwards. Right? So why is it that whenbLogonResult
does equalTrue
that it displays the message box then jumps to theMe.Close
in theElse
section? Somewhat perplexing, I sure you would agree. Any help appriciated ThanksSteve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
-
I have the following vb.net code :-
Dim bLogonResult As Boolean = Logon() If bLogonResult = True Then MessageBox.Show(bLogonResult) Else PDM.Common.ClientData.RestartApplication = False Me.Close() End If
Looks fairly straight-forwards. Right? So why is it that whenbLogonResult
does equalTrue
that it displays the message box then jumps to theMe.Close
in theElse
section? Somewhat perplexing, I sure you would agree. Any help appriciated ThanksSteve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
I'd be tempted to try: If bLogonResult Then .....
-
I'd be tempted to try: If bLogonResult Then .....
I tried that. I also tried
If Logon() Then
andIF Logon() = True Then
Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
-
I tried that. I also tried
If Logon() Then
andIF Logon() = True Then
Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
Is it DEFINATELY going into the 'Else'? You haven't got another Me.Close further down?
-
Is it DEFINATELY going into the 'Else'? You haven't got another Me.Close further down?
ABSOLUTELY DEFINATELY. I have stepped thru the code in debug mode several time to make sure.
Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
-
ABSOLUTELY DEFINATELY. I have stepped thru the code in debug mode several time to make sure.
Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
Bizarre! How about something like: Dim bLogonResult As Boolean = Logon() If bLogonResult Then MessageBox.Show(bLogonResult) ElseIf Not bLogonResult Then PDM.Common.ClientData.RestartApplication = False Me.Close() End If