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
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. But what to try?

But what to try?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpquestion
7 Posts 6 Posters 1 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.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    As found in some VB code:

    Try
    Catch ex As Exception
    End Try

    I may be posting a lot of these things here, as I finally got hold of the VB code that was for the previous system, that we're re-writing in C#. It's bound to be full of gems like this. Marc

    D B B 3 Replies Last reply
    0
    • M Marc Clifton

      As found in some VB code:

      Try
      Catch ex As Exception
      End Try

      I may be posting a lot of these things here, as I finally got hold of the VB code that was for the previous system, that we're re-writing in C#. It's bound to be full of gems like this. Marc

      D Offline
      D Offline
      DaveAuld
      wrote on last edited by
      #2

      The .net equivalent of On Error Resume Next :)

      Dave Find Me On: Web|Facebook|Twitter|LinkedIn|GitHub


      Folding Stats: Team CodeProject

      1 Reply Last reply
      0
      • M Marc Clifton

        As found in some VB code:

        Try
        Catch ex As Exception
        End Try

        I may be posting a lot of these things here, as I finally got hold of the VB code that was for the previous system, that we're re-writing in C#. It's bound to be full of gems like this. Marc

        B Offline
        B Offline
        Brisingr Aerowing
        wrote on last edited by
        #3

        I have seen that kind of code fail. Don't ask how, as I don't know.

        Getting information off the Internet is like taking a drink from a fire hydrant. - Mitchell Kapor

        1 Reply Last reply
        0
        • M Marc Clifton

          As found in some VB code:

          Try
          Catch ex As Exception
          End Try

          I may be posting a lot of these things here, as I finally got hold of the VB code that was for the previous system, that we're re-writing in C#. It's bound to be full of gems like this. Marc

          B Offline
          B Offline
          Bernhard Hiller
          wrote on last edited by
          #4

          You mean there was no code at all between Try and Catch, nor between Catch and End Try? At least, he ought to have added an empty Finally then.

          M 1 Reply Last reply
          0
          • B Bernhard Hiller

            You mean there was no code at all between Try and Catch, nor between Catch and End Try? At least, he ought to have added an empty Finally then.

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #5

            Bernhard Hiller wrote:

            You mean there was no code at all between Try and Catch, nor between Catch and End Try?

            That is correct. I did not remove any code. It was a completely empty try-catch block. Marc

            D 1 Reply Last reply
            0
            • M Marc Clifton

              Bernhard Hiller wrote:

              You mean there was no code at all between Try and Catch, nor between Catch and End Try?

              That is correct. I did not remove any code. It was a completely empty try-catch block. Marc

              D Offline
              D Offline
              devenv exe
              wrote on last edited by
              #6

              Marc Clifton wrote:

              Try Catch ex As Exception End Try

              Marc Clifton wrote:

              I did not remove any code. It was a completely empty try-catch block.

              Leaving the try...catch block empty was intentional. There exists a form with a textbox in which you can type code to be inserted in the try...catch block at runtime.

              "Coming soon"

              P 1 Reply Last reply
              0
              • D devenv exe

                Marc Clifton wrote:

                Try Catch ex As Exception End Try

                Marc Clifton wrote:

                I did not remove any code. It was a completely empty try-catch block.

                Leaving the try...catch block empty was intentional. There exists a form with a textbox in which you can type code to be inserted in the try...catch block at runtime.

                "Coming soon"

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                Then it's too bad the optimizer will remove it. :sigh:

                This space intentionally left blank.

                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