Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Can you explain this strange logic?....

Can you explain this strange logic?....

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steven J Jowett
    wrote on last edited by
    #1

    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 when bLogonResult does equal True that it displays the message box then jumps to the Me.Close in the Else section? Somewhat perplexing, I sure you would agree. Any help appriciated Thanks

    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'

    P 1 Reply Last reply
    0
    • S Steven J Jowett

      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 when bLogonResult does equal True that it displays the message box then jumps to the Me.Close in the Else section? Somewhat perplexing, I sure you would agree. Any help appriciated Thanks

      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'

      P Offline
      P Offline
      penguin5000
      wrote on last edited by
      #2

      I'd be tempted to try: If bLogonResult Then .....

      S 1 Reply Last reply
      0
      • P penguin5000

        I'd be tempted to try: If bLogonResult Then .....

        S Offline
        S Offline
        Steven J Jowett
        wrote on last edited by
        #3

        I tried that. I also tried If Logon() Then and IF 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'

        P 1 Reply Last reply
        0
        • S Steven J Jowett

          I tried that. I also tried If Logon() Then and IF 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'

          P Offline
          P Offline
          penguin5000
          wrote on last edited by
          #4

          Is it DEFINATELY going into the 'Else'? You haven't got another Me.Close further down?

          S 1 Reply Last reply
          0
          • P penguin5000

            Is it DEFINATELY going into the 'Else'? You haven't got another Me.Close further down?

            S Offline
            S Offline
            Steven J Jowett
            wrote on last edited by
            #5

            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'

            P 1 Reply Last reply
            0
            • S Steven J Jowett

              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'

              P Offline
              P Offline
              penguin5000
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups