Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 511345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:12:25+00:00 2026-05-13T07:12:25+00:00

try {… block: …. } catch{ ..} GOTO block … …. finally{…} Will goto

  • 0
try
{...
block:
....
}
catch{ ..}
GOTO block
...
....
finally{...}

Will goto executes in this case??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:12:26+00:00Added an answer on May 13, 2026 at 7:12 am

    It won’t compile because of ‘GOTO block‘ instead of ‘goto block;‘ and even if it was right it won’t compile because C# specifications states (§8.9.3):

    The target of a goto identifier statement is the labeled statement with the given label. If a label with the given name does not exist in the current function member, or if the goto statement is not within the scope of the label, a compile-time error occurs. This rule permits the use of a goto statement to transfer control out of a nested scope, but not into a nested scope.

    Also I found couple specs interesting for me too:

    A goto statement cannot exit a finally block (§8.10). When a goto statement occurs within a finally block, the target of the goto statement must be within the same finally block, or otherwise a compile-time error occurs.

    And:

    A goto statement is executed as follows:

    • If the goto statement exits one or more try blocks with associated finally blocks, >control is initially transferred to the finally block of the innermost try statement. When >and if control reaches the end point of a finally block, control is transferred to the >finally block of the next enclosing try statement. This process is repeated until the >finally blocks of all intervening try statements have been executed.
    • Control is transferred to the target of the goto statement.

    the latter means that if you have

    try
    {
        ...
        goto Label1;
    }
    finally
    {
        CloseAll();
    }
    
    Label1:
       MethodB();
    

    it will call CloseAll() before actually transferring control to the Label1 and executing MethodB().

    Makes perfect sense, but I never thought about it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 341k
  • Answers 341k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use the included javax.crypto classes to encrypt any… May 14, 2026 at 5:03 am
  • Editorial Team
    Editorial Team added an answer I copied your code and ran into the same issue.… May 14, 2026 at 5:03 am
  • Editorial Team
    Editorial Team added an answer Basic Web Protocols: Downloading from http, ftp and file: with… May 14, 2026 at 5:03 am

Related Questions

Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
try { ... } catch (SQLException sqle) { String theError = (sqle).getSQLState(); ... }
Try Dim ds As DataSet = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings(connstr).ConnectionString, CommandType.StoredProcedure, Get_All, New SqlParameter(@userid, Session(userid))) rptBundles.DataSource =
Try the following simple example: <html> <head> <style> div, input { border: 1px solid
Try recording a macro in Word 2007, notice you can't do a thing to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.