Re: What's up with this compiler hint?
- From: Jaelani <jaejunks@xxxxxxxxxxxxxx>
- Date: Sat, 28 Mar 2009 12:42:38 +0700
The "Raise;" statement will transfer execution to the parent exception handler. Even though the function result is already assigned, the execution never reached the end of function block and the function result is never returned. So, the next statement after the one that calls PPE_CreateTmpEmpListTable method is never executed. e.g.:
Try
FuncResult := PPE_CreateTmpEmpListTable(123);
Except
ShowMessage('Unhandled exception');
End;
When PPE_CreateTmpEmpListTable is called and its "Raise;" statement is executed, the FuncResult value is never assigned and the "Unhandled exception" message will be displayed after the "Failed creating processing ....." message.
I don't know exactly about your application, but removing the "Raise;" statement in the PPE_CreateTmpEmpListTable method should solve the problem.
HTH.
postman1958@xxxxxxxxx wrote:
Why would the compiler tell me that.
the line "Result := -1;" never runs?
"Value assigned to TdmlProcessing.PPE_CreateTmpEmpListTable never
used."
TIA
Kai
function TdmlProcessing.PPE_CreateTmpEmpListTable( const listID:
integer): integer;
begin
try
qryCreateTmpEmpList.ExecSQL;
...
...
except on E: EDBEngineError do
begin
Result := -1;
ShowMessage('Failed creating processing .....);
Raise;
end;
end;
end;
- References:
- What's up with this compiler hint?
- From: postman1958
- What's up with this compiler hint?
- Prev by Date: Re: What's up with this compiler hint?
- Next by Date: how can i limit memory using in my application?
- Previous by thread: Re: What's up with this compiler hint?
- Next by thread: how can i limit memory using in my application?
- Index(es):
Relevant Pages
|