# DOEDIT()

Syntax:

Then: xx=DOEDIT(val_expr,edit_expr)

Then: xx=DOEDIT(val_expr,edit_expr,len_expr)

"val_expr" is the value to be passed through the edit.
"edit_expr" is the name of the edit to apply.
"len_expr" is the length of the resulting value.
If len_expr is not specified, the length of val_expr is used.

Return value is a field of edit type edit_expr and length len_expr, if specified. Otherwise, the length is the same as
val_expr.

Note: If "edit_expr" is not found, then it is treated as a NOEDIT.

Version Ref: 4.5

Description:

Performs an edit on a value, and returns the result.

Examples:

Right justify and zero-fill field "partno", a (10,*) field.

The old method:

Then: xx(10,rj) = partno ; xy(10,rj0) = xx ; partno = xy

The new method:

Then: partno = doedit(doedit(partno,"rj"),"rj0")

Note how the two fields that were previously needed exclusively for this conversion, can be eliminated by using DOEDIT.