Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > XTREE > XTREE Parameters > Coldef > Cformat

Conditional validation

Scroll Prev Top Next More

cformat switch: X

The conditional validation option forces XTREE to return with Exitcode -48 whenever a cell in the corresp column has changed, or, in the case of editable read-only, is about to change, so that the application can perform validation. It may be combined with any cformat code indicating a column whose contents can be changed by the user (e.g. E, T, R,  l , etc.).

In the normal case, the exit for validation is triggered after the cell has changed. If the application doesn't want to accept the change, it can either reset the cell itself, or force the user back into that cell to make an acceptable change. In contrast, for Read-only editable (u) cells, the conditional validation option exits (again with exitcode -48) when the user signals the desire to make a change but before any change has occurred, i.e. to allow for pre-validation.

Whenever the conditional validation option forces an exit, in addition to exitcode being set to -48, the following fields within the xtrctl parameter will be set:

XTR.xrow and XTR.xcol will indicate the cell that previously had the focus.
XTR.targetrow and XTR.targetcol will indicate the cell that will get the focus next (i.e. the cell that was clicked or is otherwise next in the navigation sequence).
XTR.validate will be set to 1 if the former cell needs validation (i.e. was changed); 2 if the latter (target) cell needs pre-validation (for editable read-only), or 3 if they both need validation.

See Also