06-16-2010, 08:38 PM
The are called #pragmas (this is a standard compiler feature on most compilers). Instead of using #option, use #pragma option.
Unfortunately, YES, this is very undocumented. See how library/*.bas uses them. The reason they're undocumented is because they're being worked on and refactored at the moment.
A brief explanation follows:
To change any option use
For boolean options, you can use either "TRUE" | "FALSE" or 1 | 0
Example:
Disabling case-sensitive identifiers:
Some times you might want to save current option status, to be recovered later. There is a "Stack" for this. So, to save a current option do:
Note: wrong push/pop sequences will lead to unpredictable results (can even crash the compiler).
The above technique is used in many library/*.bas files to make some functions case insensitive. For example, POINT and SCREEN$ functions came with Sinclair BASIC and they must be case insensitive. So saving the case_insensitive option temporarily we won't interfere with user's options status
The options list grows almost day by day. But here are the most common and useful of them (at the moment), 'NAME', type, default value:
Unfortunately, YES, this is very undocumented. See how library/*.bas uses them. The reason they're undocumented is because they're being worked on and refactored at the moment.
A brief explanation follows:
To change any option use
Code:
#pragma option <optionName>=Value
Example:
Disabling case-sensitive identifiers:
Code:
#pragma option case_insensitive = TRUE
Code:
#pragma push(case_insensitive)
#pragma option case_insensitive = TRUE
...
...
#pragma pop(case_insensitive)
The above technique is used in many library/*.bas files to make some functions case insensitive. For example, POINT and SCREEN$ functions came with Sinclair BASIC and they must be case insensitive. So saving the case_insensitive option temporarily we won't interfere with user's options status

The options list grows almost day by day. But here are the most common and useful of them (at the moment), 'NAME', type, default value:
- 'optimization', int, 0
- 'case_insensitive', bool, False
- 'array_base', int, 0
- 'byref', bool, False // Whether function parameters are byRef or byVal if this is ommited
- 'max_syntax_errors', int, DEFAULT_MAX_SYNTAX_ERRORS
- 'string_base', int, 0