CompressFlds
Use this function/procedure to compress blank space by moving field data. This function moves field data from one field to a prior named field to compress the space between the fields. Typically you use this function to compress vertical space, as in address lines, but the fields do not have to be vertical relative to each other. You can compress any field.
Note | The data moves between the fields; the actual location of each physical field remains the same. |
CompressFlds can be used as a procedure or as a function.
Syntax
CompressFlds (FieldList, Section, Form, Group)
Parameter |
Description |
FieldList |
Enter a list of the fields you want to compress, separated by commas. Here is an example: "FIELD1, FIELD2, FIELD3" |
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. |
Note | When using this function in Documaker Server processing, make sure the fields exist on the section. Some implementations that use versions of the system prior to version 11.0 do not load FAP files in all cases, and fields will not be created when data mapping did not place any data into the field. |
Keep in mind...
- Each subsequent field with data is mapped into the first available empty field which you included in the list.
- Fields are defined in FAP sections with a tabbing order. This tabbing order typically matches the order in which field level rules are processed during Documaker Server processing. Unlike the SetAddr rules, the CompressFlds function can compress fields in any order, and the field spaces do not have to be compressed up following the tabbing order.
- The last movement of that field determines the final location of a given field's data.
- Always specify a set of unique field names. Do not attempt to name a field more than once within a field list as this can produce unpredictable results.
- This function does not work with bar code or multiline text fields.
Example
For this example, assume the following fields and data:
This field |
Contains |
FIELD_A |
ABCDEFG |
FIELD_B |
is empty |
FIELD_C |
is empty |
FIELD_D |
TUVWXYZ |
Assume your field list looks like this:
"FIELD_A, FIELD_B, FIELD_C, FIELD_D"
FIELD_A does not move because there is no field named before it.
FIELD_B and FIELD_C are empty; therefore, the data from FIELD_D moves into FIELD_B, which is the first available empty field.
The result looks like this:
This field |
Contains |
FIELD_A |
ABCDEFG |
FIELD_B |
TUVWXYZ |
FIELD_C |
is empty |
FIELD_D |
is empty |
If you had specified the field list parameter had been specified like this:
"FIELD_D, FIELD_C, FIELD_B, FIELD_A"
The result would be as follows:
This field |
Contains |
FIELD_A |
is empty |
FIELD_B |
is empty |
FIELD_C |
ABCDEFG |
FIELD_D |
TUVWXYZ |