General information
Category:
Coding, syntax & commands
>Ciao Fabio,
>
>OK, assuming that the finally doesn't allow the error to surface, I still don't understand why this piece of code enters an infinite loop.
>
>When you run it in the debugger (again, don't try from the IDE), execution will go back to the beginning after catching the error.
>
>Alex
>
>
>>The cause is FINALLY, it hides the endtry error.
>>Without FINALLY,
>>when VFP execute TRY, it check for the ENDTRY;
>>with FINALLY this don't happen.
>>
>>Fabio
Personally I have not had time to inquire on the operation of the VM's PC (program counter) of VFP.
From the first moment, it seems that TRY it creates a nested PC,
ENDTRY update the previous level PC(-1) with the length of the try/endtry block.
Because ENDTRY is not found, it does not update PC(-1), and the VM continue the execution
with the PC value that point to TRY command, then the loop infinite happen.
The mechanism could be various, but sure a PC remains static.
The DEBUGGER it interferes with this mechanism.
In fact the Debugger of VFP is not a probe external debugger,
but it is part of the VM;
therefore the fact that a program functions correctly
in the debugger does not guarantee that functions to runtime.
Fabio
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only