contents   index   previous   next



The continue function is provided to allow an API application to process code while a script is being executed. One use of it is to implement a debugger. A second use is to process Windows messages. This section pulls all the information about the continue function into one place.


The function is provided by the API user in the seContextParams structure provided to the seCreateContext API call. During seEval script evalation, the function is called after each statement in the script is processed. However, the seEval call can be provided with the SE_INFREQUENT_CONT flag to call the function far less often. This flag is useful when code must be processed occassionally but not nearly as frequently as after each statement. Because debuggers must regain control after each statement, the seContextParams has a flag SE_OPT_DEBUGGER. This flag overrides the SE_INFREQUENT_CONT flag. This allows the API user to use the SE_INFREQUENT_CONT flag whenever it makes sense. A debugger can then optionally be used on the same code correctly, without changing that code.


Finally, when using the SE_START flag with seEval to execute code one piece at a time, control is automatically returned from the seExec API call after each script chunk. The amount of code executed in each call to seExec is determined by the presence or absence of the SE_INFREQUENT_CONT flag and the SE_OPT_DEBUGGER flag. Since control is returned to the caller after each seExec call, the continue function is not called in this case. However, you may wish to call it yourself, depending on your application.