The
preproc statement declares that the statements following it are executed at the beginning of a run, case, level, record, form, roster, or field.
In data entry applications, statements in a
preproc procedure are executed when you move
forward onto an object. Moving forward occurs when the execution flow moves the cursor onto the object, or when the user goes forward to the object by any means (mouse-click, tab key, arrow keys, etc.). If you move
backward onto an object,
preproc statements are
not executed. Moving backward occurs if a keyer reenters a value, goes backward with a mouse click, or uses the Shift+tab or arrow keys to move backward. If you want to execute the statements when you move both forward and backward onto a field, code them in the
onfocus procedure.
In batch edit applications, a
preproc is used to execute logic at the beginning of a run, case, level, or record. For an item there is no difference between placing your logic in a
preproc or
postproc.