Informix Error -9504: The argument number is out of bounds for the ascii function. Arguments must be between 0 and 255, inclusive.
Cause and resolution
The argument number is out of bounds for the ascii function. Arguments must be between 0 and 255, inclusive.
The input to the ASCII function must be a number between 0 and 255. Examine the use of this function in the report specification. If the improper value number came from a command-line parameter, you might consider testing it with an IF statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9504 fires when the argument passed to the report's ASCII function is outside the 0-255 range — per the official guidance.
- An ASCII function argument outside 0-255, per the official guidance — the direct, only cause.
Solutions / Resolution
- Examine the use of the ASCII function in the report specification, per the official guidance.
- If the improper value came from a command-line parameter, consider testing it with an IF statement, per the official guidance.
Examples
An out-of-range ASCII argument
LET c = ASCII(300) -- -9504: 300 is outside 0-255
Corrected — guarding with an IF statement
IF param >= 0 AND param <= 255 THEN
LET c = ASCII(param)
END IF
Diagnostic Checks
- Check the value passed to ASCII() — especially if it originates from a command-line parameter — and guard it with an IF statement if out of range.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -9504 in this set yet.
An ASCII function argument was outside the valid 0-255 range — guard the value with an IF statement.