How to disable the BASIC Compile stage, or modify the Compile stage so that errors it detects do not the halt program flow?
A BASIC script is used to create a new module that contains a BASIC subroutine, and the original BASIC script then makes a Call to execute the code in this newly created subroutine.
The Call to the newly created code appears to be subjected first to a “Compile” phase and then to the “Run” phase.
If errors (e.g. parentheses do not match, or divide by zero) are detected during the “run” stage then, through the use of “on local error goto...” error handler, the code can recover from the error and code execution can continue.
If errors are detected during the “compile” stage, then these are non-recoverable and code execution is halted. The syntax error must be manually corrected and the program re-started.
Is there a way to set the “compile” stage to report the errors that it detects in a way that is recoverable through an error handler?
I am also wondering if there might be some sort of OpenOffice global parameters that can be set to adjust the way the compile phase is performed?
Perhaps there is a way to turn off the compile phase so that there is only the Run phase?
I am creating a “formula calculator and plotter” for school students. The idea is that they create their own equations, and then submit the equations to calculate plotting points that are then used to draw a curve. I create a new module to execute the code that includes the equation the student created. If the equations syntax is OK then I have no problems. If the equation has a syntax error, then the compile phase halts the program with an unrecoverable error. I want to be able to evaluate the equation and if it has a syntax error then I want the program to recover and warn the student to re-enter the equation, but with the correct syntax.
I appreciate all ideas and alternative options on how to get this self modifying style of code working.
thanks, ian.