Microsoft KB Archive/31229

Compiler Error, Literal Subscripts Out of Bounds

PSS ID Number: Q31229 Article last modified on 04-21-1993

2.00 2.10 2.20 MS-DOS

Summary: Microsoft COBOL does not check table/array subscripts for range validity at run time. However, the compiler does generate the following error when a literal subscript is specified that exceeds the table boundary (i.e., A(10) versus A(INDEX-VARIABLE)) : Subscript 0 over maximum number of occurrences; # used # Variable subscripts that exceed array boundaries do not generate a compile error. This is expected behavior. At execution, results of the two programs will be identical, as the ANSI standard dictates.

Additional reference words: 2.00 2.10 2.20 Copyright Microsoft Corporation 1993.