![]() ![]() ![]() |
These are unrecoverable errors that cause a program to fail if the commands are executed. It is possible, however, that these types of errors might exist in routines that run correctly. The error occurs (or may occur, depending on the underlying implementation) only when the errant commands are executed.
XINDEX can only check static numbers in code. It does not check the boundaries of the number, only that it is a legitimate number and not a string.
This error is usually a WRITE argument misuse. The most common occurrence is due to a missing comma after the argument.
These are potentially one of the most serious types of errors, and may lead to fatal runtime exceptions. However, examination of a number of routines indicates that a significant number of these errors are empty DO blocks. These are still potential logic errors, but do not cause runtime exceptions under Caché. The DO command, Section 8.2.3 of the standard, does not seem to have a provision for empty blocks, so this is an error.
The following code extract from ENGET^DGRUGMFU is an example of this type of error:
ENGET() ;DETERMINE DIVISION TO GET SUBSCRIBERS ; N I,J,X F I=1:1 X HLNEXT Q:HLQUIT'>0 D .S X(I)=HLNODE,J=0 ..F S J=$O(HLNODE(J)) Q:'J S X(I,J)=HLNODE(J) |
Because there is no DO command before the double dot syntax, that line is never executed.
In this case, reference is made to a label inside a routine that is not (or no longer) present. There could be many reasons for this. The most likely candidate being removal of code that is no longer used.
This is the complementary situation in which code calls a label/routine that is no longer present on the system. Again, there are a number of reasons why this might occur, including typographical errors and removal of code that is no longer used.
This is another syntax type error. Most M command arguments are optional. This error is usually associated with the WRITE argument tab character, which is the question mark (?). It must be followed by an integer or variable.
XINDEX checks that only the seven pattern codes (i.e., ACELNPU) are used. They also can be lower case (i.e., acelnpu). The seven pattern codes are defined as:
This error is only for the argumentless FOR command. It must be followed by two spaces.
XINDEX checks that if the FOR command has an argument, it must set a variable.
This error indicates a construct that is not valid M syntax and is otherwise unrecognized. Almost any malformed code is possible here.
This is another error that has to with the dot syntax used to create anonymous blocks in standard M. Typically, a GOTO that jumps from one stack level to another would generate this type of error.
TEST ;test routine F I=1:1 D . S X=1,Y=Z .I Y>0 G QUIT^TESTA .S Z=0 |
In this example, the code is trying to GO out of the DO block to another routine.
This error involves calling functions with the wrong number of arguments, or with invalid argument syntax.
M allows the arguments to commands (e.g., DO) to be specified indirectly (i.e., via the @ syntax). What is not standard, however, is to use indirection just to specify the label in a label^routine combination.
The following code extract from EN+6^MXMLPRSE is invalid:
F Q:EOD D READ,EPOS,@ST^MXMLPRS0:'EOD |
Most M commands allow a post condition, which is designated by a colon and followed by the argument. This error occurs if the argument is missing.
XINDEX flags all uses of Z commands. Vendor-specific commands use the Z prefix. The SAC restricts the use of such commands to Kernel. You may occasionally see other packages make use of these commands, but in these cases, an exemption is required.
XINDEX checks that anywhere a quoted string is used, it must stand alone or have a separator after it.
These errors flag references to routines that are not present on the system.
This is a syntax error. It requires a manual check of the line/routine.
Checks that a function is part of the M standard.
This is essentially the same as the "F—Undefined Function" error. The only difference is that in M special variables are built-in functions that take no arguments.
This is a syntax error. XINDEX checks that the static code has matching parenthesis. It does have problems when indirection is used, which are evaluated during execution.
This is a syntax error. XINDEX checks that the static code has matching quotation marks. It does have problems when indirection is used, which are evaluated during execution.
XINDEX checks the syntax of the SET statement. It does have problems when indirection is used, which are evaluated during execution.