|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Is there a way to return a value in the finally section of a Try/Catch? I need a value populated if that occurs but can't seem to find a way to do it.
__________________
I Need Help |
| Sponsored Links |
|
|
|
|||
|
You can't return out of a finally statement because of the way the stack is being unwound. The Finally block will run regardless of an exception or not, and isn't really practical to return out of anyway...
If you give an example of what you're trying to do, perhaps I could give you more info? |
|
|||
|
The concept of a Stack is fairly simple. Push adds to the top, Pop takes off the top. It's basically a LIFO (Last In, First Out) queue (an actual Queue would be FIFO - First In, First Out; Push adds to the bottom, Pop takes off the top.).
For the stack concept applied to executing a program, typically termed a call stack, Wikipedia has a decent article. For specifics of the CLR execution stack, and the way a finally block is attached to it (as well as a lot more), Joe Duffy's Professional .NET Framework 2.0 is a pretty good, easy reading intro. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Return random numbers without duplicates | Paradine | PHP Tutorials | 0 | 08-26-2007 02:07 PM |
| A simple TicTacToe game | Zunone | C and C++ | 1 | 08-16-2007 11:01 AM |
| Dictonary Program | programmer 101 | Java Help | 9 | 07-01-2007 01:39 PM |
| null exception problem | connor7777 | C# Programming | 2 | 03-28-2007 11:37 AM |
| Two return methods | NeedHelp | C# Programming | 3 | 07-18-2006 05:59 AM |
| Xav | ........ | 1357.94 |
| MeTh0Dz|Reb0rn | ........ | 1083.85 |
| WingedPanther | ........ | 919.18 |
| marwex89 | ........ | 906.86 |
| morefood2001 | ........ | 903.18 |
| John | ........ | 902.37 |
| Brandon W | ........ | 789.89 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 264.99 |
| dcs | ........ | 240.34 |
Goal: 100,000 Posts
Complete: 83%