Pragmas

You can add pragmas to your scripts to control the sanScript compiler. All pragmas begin with the keyword pragma() and use additional arguments to specify the instruction to give to the compiler. For example, you can specify how the compiler handles certain syntax issues, such as warnings for literal strings.

The following script contains a literal string. When you compile this script, a warning will be generated.

local string error_string;

error_string = "This is an invalid user name.";

You can use a pragma to disable the warning generated for this script. The following script contains the pragma to disable the warning.

local string error_string;

{Turn off the warning for literal strings}
pragma(disable warning LiteralStringUsed);

error_string = "This is an invalid user name.";

{Turn the literal string warning back on}
pragma(enable warning LiteralStringUsed);

When using a pragma to turn off a compiler warning, you need to re-enable the warning before the end of the script. If you don’t, you will generate another compiler warning indicating the situation.


Documentation Feedback