Previous Topic: Error HandlingNext Topic: Using $RC in Error Procedures


Preventing Errors

Code all programs with careful consideration to potential runtime errors. The errors most frequently encountered involve improper handling of data. These errors are attempts to assign a value that is of an inappropriate data type, format, or size to a column or field. You can test the values thoroughly and manipulate them before making an assignment using the comprehensive set of functions in the CA Ideal Procedure Definition Language (PDL).

The following are simple examples of functions that ensure that the data assigned to a column conforms to the column attributes:

The $ROUND function assigns a numeric value with two decimal positions to the field OPEN$:

SET OPEN$ = $ROUND(value,FACTOR = .01)

For more information about CA Ideal functions, see the Programming Reference Guide.