Offset

Takes 7 parameters, FieldBase, Destination, Source, OffsetVal, Operator, OpValue, IfLenFld

Description:

The Offset command is used to copy or operate on values from multiple records, typically used to down-fill logic.

Usage:

FieldBase, Destination, Source, OffsetVal, Operator, OpValue, IfLenFld
[WorkWith], Destination, Source, OffsetVal, Operator, OpValue, IfLenFld
[WorkWith], Destination, Source, OffsetVal, Operator, OpValue, [""]
[WorkWith], Destination, Source, OffsetVal, [""], [""], [""]
FieldBase, Destination, Source, OffsetVal, Operator, OpValue, [WorkIf]
[WorkWith], Destination, Source, OffsetVal, Operator, OpValue, [WorkIf]
[WorkWith], Destination, Source, OffsetVal, Operator, OpValue, [WorkIf]
[WorkWith], Destination, Source, OffsetVal, [""], [""], [WorkIf]

For each Record in the Work Query, the Source Field will be copied from another Record before or after it as indicated by the numeric value in the OffsetVal parameter. For example, if OffsetVal is set to -1 then the value will be copied from the previous record. OffsetVal may reference a Field name, or be a fixed value.

This command auto-protects against out of range: If an OffsetVal of -1 is used, the first Record will of course not be able to look at a previous record. In such cases no change is made to the Destination.

The use of an Operator is optional. Available Operators are:

OpValue may be a fixed value, or a Field name. If the OpValue parameter is a Field name, it will by default reference the same Record as Source (i.e. it will be offset as well). In order to specify an Offset for OpValue other than the Source Record, place a leading number and a space in front of the Field Name for OpValue, where 0 will result in the use of the Destination's Record.

Examples:

Default of behavior of OpValue referencing the same Record as Source, i.e. -1:

Offset "MyDest", "MySource", -1, +, "MyDest"

Using the OpValue from the Destination Record:

Offset "MyDest", "MySource", -1, +, "0 MyDest"

Using the OpValue from a different offset than Source:

Offset "MyDest", "MySource", -1, +, "-2 MyOtherSource"

Notes:

The commands SetFirst and SetLast are complementary to Offset; in most cases one of them is used prior to calling Offset in order to set the beginning of the logic chain.