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.


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.