You are here: Function Reference > Alphabetical Listing > C > ConnectFlds

ConnectFlds

Use this function/procedure to move fields (change field coordinates) in such a way as to make the field’s text appear to be concatenated. This function does not literally concatenate the fields but instead repositions and aligns field text along a common horizontal coordinate so the field’s data appears concatenated. It does not move fields vertically.

This function automatically loads the section — either the FAP file or the compiled version of the FAP file — if the section has not already been loaded. FAP files must be loaded to provide some of the information required to perform the operation.

Syntax

ConnectFlds (FieldList, Section, Form, Group)

Parameter

Description

FieldList

A list of the fields you want to connect, preceded by a movement flag and separated with commas. Here is an example:

"FIELD1, FIELD2, FIELD3"

If a field name is not preceded by a movement flag or if it is preceded by the F movement flag, which indicates it is a fixed field, the field is not moved.

The first field you name in the parameter must be a fixed field. The rest of the field names in your list indicate fields you want moved adjacent to the fixed field. Each field you name is moved according to the use described by the movement flag that precedes its name.

Section

(Optional) Enter the name of a section that contains the fields you specified. The default is the current section.

Form

(Optional) Enter the name of a form that contains the section and/or field you specified. The default is the current form.

Group

(Optional) Enter the name of the form group that contains the form, section, or fields. The default is the current group.

In the FieldList parameter you must specify a fixed field and at least one field to move (visually concatenate) to the left or right side of the fixed field. You can specify multiple fields to move.

Note This function does not move fields vertically. Fields are only moved horizontally. You should set the vertical alignment of fields when you create the section.

By default, each concatenation will be placed the distance of one space character from the fixed field, unless the parameter indicates otherwise. You can include these movement flags in the FieldLIst parameter:

Flag

Description

L

Tells the system to move the specified field so it appears to be appended to the left of the fixed field.

R

Tells the system to append the specified field to the right of the fixed field.

NO

Tells the system you want no spacing between the two fields.

Here is an example:

"F=FIELD1,RNO=FIELD2"

Here, the contents of FIELD2 are placed immediately adjacent to the end of the contents of FIELD1 without an intervening space.

Keep in mind...

Example

For the following examples, make these assumptions:

This field

Contains

FIELD1

ABC

FIELD2

DEF

FIELD3

XYZ

If you enter:

ConnectFlds("F=FIELD1,R=FIELD2")

You get this result:

ABC DEF

If you enter:

ConnectFlds("F=FIELD1,L=FIELD2,R=FIELD3")

You get this result:

DEF ABC XYZ

This example appended FIELD2 to the left side of FIELD1 and appended FIELD3 to the right side of FIELD1. The fixed field, FIELD1, did not move. FIELD2 and FIELD3 moved to align with FIELD1. During this operation, FIELD1 never moved.

If you enter:

ConnectFlds("FIELD1,LNO=FIELD2,RNO=FIELD3")

You get this result:

DEFABCXYZ

This example is similar to the prior example but uses the NO parameter.

If you enter:

ConnectFlds("F=FIELD1,R=FIELD2,R=FIELD3")

You get this result:

ABC DEF XYZ

In this example, two fields are appended to the right of the fixed field. The first appended field expanded the rectangle, which allows the next one to append after the last.

If you enter:

ConnectFlds("F=FIELD1,R=FIELD2,F=FIELD2,R=FIELD3")

You get this result:

ABC DEF XYZ

Notice that the result of this example is the same as the previous example. In this case, the fixed field was changed to FIELD2 after FIELD2 had moved adjacent to FIELD1. Then FIELD3 was moved adjacent to FIELD2 in its new location.

If you enter:

ConnectFlds("F=FIELD1,R=FIELD2,R=FIELD2")

You get this result:

ABC DEF

In this case, FIELD2 is defined to move twice. Since the operations are sequential, the field first moved adjacent to FIELD1. This movement expanded the fixed rectangle used by subsequent movements. When the field was named again, it moved relative to the newly expanded rectangle, resulting in the field appearing farther to the right, a distance equal to the size of the text in the field plus the width of two spaces.

See also