Overview | Statement List | Example
GRIPSW/DECLRV
The statement is used for compiler directives. If used with the minor word directive DECLRV, it prevents the program from compiling if the program contains undeclared simple variables. This ensures that all variables are declared before they are used in the program. This reinforces the data assignment to the correct variable types.
During compilation, if the compiler comes across an undefined simple variable, it generates error number 62, UNDEFINED VARIABLE.
You can place the GRIPSW statement anywhere in the declaration section, but it must come before the first executable statement. For example, this declaration:
NUMBER/a,b
GRIPSW/DECLRV
STRING/STR(2,30),NAME(6)
.
.
a
= 10
.
.
would have the same result as this:
GRIPSW/DECLRV
NUMBER/a,b
STRING/STR(2,30),NAME(6)
.
.
a
= 10
.
.
Parameter |
Description |
DECLRV |
Minor word which detects undeclared variables. |