It will execute the
return
statement - i.e. it will evaluate the parameter - and then it will execute the
finally
block. After that it will adjust the stack and return execution (along with the value) to the calling function.
If you aren't sure, then create some dummy code and test it:
private void myButton_Click(object sender, EventArgs e)
{
Console.WriteLine("Before");
Console.WriteLine(ShowMe());
Console.WriteLine("After");
}
private int ShowMe()
{
try
{
Console.WriteLine("Try");
return ShowReturn();
}
finally
{
Console.WriteLine("Finally");
}
}
private int ShowReturn()
{
Console.WriteLine("ShowReturn");
return 1;
}
You will get:
Before
Try
ShowReturn
Finally
1
After
Which shows the order quite nicely.