Olaf Doschke
Programmer
The strangest things happen lately:
I get error 96 (Nesting error) ereported in a certain inherited method, but in no particular line number (lineno() is 0)
This seems very weird to me, as a nesting error would stop the compilation at build time and would never be able to happen at runtime. The only way a nesting error could be expected at runtime is due to Execsript(), which is not in play here. Even macro substitution cannot cause it, as you can't substitute anything needing multi line code to be nested at all.
So the master question is: In what circumstances could a nesting error occur?
One detail: The method in question is called PreSaveHook and called from the save method of a data access class:
This is the lowest nesting level of the save method, so no nesting can be broken on this level, too. One further mentionable thing is, that data access objects may be "stacked", in that a parent object starts a transaction and trigger child objects save, after itself successfully saved.
At least it's not urgent, because it wasn't reproducable, but it would good to know how to get at the source of a nesting error, if one happens. ASTACKINFO is on my list, I thought it's already used in the general error handler, but no stack info is reported in the error screenshot. Line 0 is something I normally only get, if a database trigger fails, but in this case the backend is MS SQL Server, not a DBF of a DBC.
Could a network error cause some object to fail and cause a nesting error?
Bye, Olaf.
I get error 96 (Nesting error) ereported in a certain inherited method, but in no particular line number (lineno() is 0)
This seems very weird to me, as a nesting error would stop the compilation at build time and would never be able to happen at runtime. The only way a nesting error could be expected at runtime is due to Execsript(), which is not in play here. Even macro substitution cannot cause it, as you can't substitute anything needing multi line code to be nested at all.
So the master question is: In what circumstances could a nesting error occur?
One detail: The method in question is called PreSaveHook and called from the save method of a data access class:
Code:
If Not This.PreSaveHook()
*--- If presave conditions fail, cancel save
Return CANCEL
Endif
This is the lowest nesting level of the save method, so no nesting can be broken on this level, too. One further mentionable thing is, that data access objects may be "stacked", in that a parent object starts a transaction and trigger child objects save, after itself successfully saved.
At least it's not urgent, because it wasn't reproducable, but it would good to know how to get at the source of a nesting error, if one happens. ASTACKINFO is on my list, I thought it's already used in the general error handler, but no stack info is reported in the error screenshot. Line 0 is something I normally only get, if a database trigger fails, but in this case the backend is MS SQL Server, not a DBF of a DBC.
Could a network error cause some object to fail and cause a nesting error?
Bye, Olaf.