All conversions of character data are carried out character-by-character in a left-to-right sequence. The condition is raised for each invalid character. The condition is also raised if all the characters are blank, with the following exceptions:
Note that if a null string or a string of one or more blanks is assigned to a numeric variable, the CONVERSION condition will not be raised.
When an invalid character is encountered, the current action specification for the condition is executed (provided that CONVERSION is not disabled). If the action specification is an ON-unit, the invalid character can be replaced within the unit.
If the CONVERSION condition is raised and it is disabled, the program is in error.
If the CONVERSION condition is raised during conversion from graphic data to nongraphic data, the ONCHAR and ONSOURCE built-in functions do not contain valid source data. The ONGSOURCE built-in function contains the original graphic source data. The graphic conversion is retried if the ONGSOURCE pseudovariable is used in the CONVERSION ON-unit to attempt to fix the graphic data that raised the CONVERSION condition. If the ONGSOURCE pseudovariable is not used in the CONVERSION ON-unit, the ERROR condition is raised.
|
If CONVERSION was raised on a graphic source and the ONGSOURCE pseudovariable is used in the ON-unit, the program retries the conversion on return from the ON-unit.
If CONVERSION was raised on a widechar source and the ONWSOURCE pseudovariable is used in the ON-unit, the program retries the conversion on return from the ON-unit.
If the conversion error is not corrected using these pseudovariables, the program loops.