#Pragma Directive
Used to speed up code execution by turning off certain automatic tasks. When a pragma directive is used, the automatic task remains off until the end of the method in which it is called (or is enabled by calling it again and specifying True), but not in other methods that might be called within the original method.
#pragma Directive
or
#pragma Directive True or False
Directive | Description |
BackgroundTasks | Enables or disables auto-yield to background threads. In addition to the pragma directive, specify True or False. Setting this directive to False is the same as using disableBackgroundTasks) |
BoundsChecking | Enables or disables bounds checking. In addition to the pragma directive, specify True or False. Specifying False is the same as using disableBoundsChecking. |
DisableAutoWaitCursor | Used to disable the automatic display of the wait cursor (or watch cursor). In versions 5.0 and above, the scope of this pragma is no longer global. The wait cursor will be disabled in the method that calls the pragma until the method ends. For example, if DisableAutoWaitCursor is called in a Pushbutton that runs a loop, the wait cursor will be disabled only until the loop runs and the Action event has completed. |
DisableBackgroundTasks | Used to turn off automatic background task handling for code after the #pragma. It prevents REALbasic from yielding time back to the operating system, other applications, and threads. It can speed up very processor-intensive operations but prevents REALbasic from displaying the Watch cursor, may halt normal background updating of interface elements, and prevents other threads from executing. |
DisableBoundsChecking | Used to turn off array bounds checking on array index values in code after the #pragma. |
NilObjectChecking | Controls whether to automatically check objects for Nil before accessing properties and calling methods. In addition to the pragma directive, specify True or False. |
StackOverflowChecking | Controls whether to check for stack overflows. In addition to the pragma directive, specify True or False. |
Notes
Four pragma directives require that you pass True or False to turn the option on or off. Since these pragmas can be enabled or disabled, you can now do things like disable background tasks for an inner loop, but leave them enabled for the outer loop: