Informix Error -1107
-1107 Field subscript out of bounds.
The subscript of a screen array in an INPUT, DISPLAY, or CONSTRUCT statement is either less than 1 or greater than the number of fields in the array. Review the program source in conjunction with the form specification to see where the error lies.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1107 fires when a screen array's subscript, used in an INPUT, DISPLAY, or CONSTRUCT
statement, is either less than 1 or greater than the number of fields actually in the array —
per the official guidance, this requires reviewing both the program source and the form
specification together to locate.
- A subscript less than 1, per the official guidance — an off-by-one or zero-based indexing mistake against Informix's 1-based screen array indexing.
- A subscript greater than the number of fields defined in the screen array, per the official guidance — the array in the form specification has fewer fields than the program code assumes.
Solutions / Resolution
- Review the program source alongside the form specification, per the official guidance, to find where the subscript and the actual array size disagree.
- Correct the subscript bounds in the program logic, or extend the screen array in the form specification, whichever reflects the actual intended design.
Examples
A subscript beyond the array's size
-- form specification defines a screen array with 5 rows
-- program code:
FOR i = 1 TO 6
DISPLAY item_row[i] TO scr_item[i]
END FOR
-- -1107: scr_item[6] doesn't exist; the screen array only has 5 rows
Diagnostic Checks
- Compare the subscript range used in the program against the actual number of fields defined for the screen array in the form specification.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1107 in this set yet.
A screen array subscript fell outside 1..N (N = the array's actual field count) — review the program source against the form specification to find the mismatch.