Pragma reference

The following is a list of the pragmas available to control warnings generated by the sanScript compiler. Each warning can be disabled by the following code:

pragma(disable warning constant);

The warning is re-enabled by the following code:

pragma(enable warning constant);

LiteralStringUsed

The LiteralStringUse pragma setting turns off the warning generated by using literal strings in scripts. The following example shows this setting.

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);

PossibleInfiniteLoop

The PossibleInfiniteLoop pragma setting turns off the warning generated when a possible infinite loop is detected.The following example shows this setting.

pragma(disable warning PossibleInfiniteLoop);
while true do

	if 'Result' = true then
		exit while;
	end if;

end while;
pragma(enable warning PossibleInfiniteLoop);

TypeMismatch

The TypeMismatch pragma setting turns off the warning generated when a possible loss of data is detected when performing assignments. The following example shows this setting.

local integer int_val;
local long long_val;

pragma(disable warning TypeMismatch);

int_val = long_val;

pragma(enable warning TypeMismatch);

UnusedVariable

The UnusedVariable pragma setting turns off the warning generated when an unused variable or parameter is detected.The following example shows this setting.

local integer unused;

pragma(disable warning UnusedVariable);

The UnusedVariable setting should not be enabled again before the end of the script. It will apply only to the current script.


 


Documentation Feedback