The Finally block contains the invocation of a statement that is forbidden to be used in this block by the Fore language.
Delete the invocation of the invalid statement.
Sub UserProc(Skip: Boolean);
Begin
Try
//Checked operations
Except On e: DirectoryNotFoundException Do
If Skip Then
Return;
Else
//Error handling
End If;
On e: FileNotFoundException Do
If Skip Then
Return;
Else
//Error handling
End If;
Finally
Return;
End Try;
End Sub UserProc;
When the specified code is compiled, the Return string in the Finally block displays the following error: Invalid use of statement in the finally block. To resolve the error, delete the Return statement from this block.
See also: