Re: What's up with this compiler hint?



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;
.



Relevant Pages

  • Re: After RAISERROR executes next line.
    ... If I understand you correctly you want to raise an exception so that the ... print statement is NOT executed?. ... > I am trying to raise an error in MS SQL Server 2000 using the lines ... > But, on execution, it shows the error message and goes to the next line. ...
    (microsoft.public.sqlserver.server)
  • raise and rescue
    ... Is is possible to raise an exception then rescue it and then go back to ... whereever it was raised and continue with execution? ...
    (comp.lang.ruby)
  • Re: Best Way to Debug Startup Code?
    ... break I can insert which will raise the IDE yet not cause an error ... The Stop statement suspends execution, but unlike End, it doesn't ...
    (microsoft.public.access.formscoding)
  • Re: Structured exception information
    ... AARM 5.1/13: ... "The execution of a null_statement has no effect." ... But 11.1(which says anything can raise Storage_Error) trumps that. ...
    (comp.lang.ada)