AppendText

Use this procedure/function to attach additional text to the end of a multiline text field from an external ASCII text file. This procedure only works on multiline text fields.

Syntax

AppendText (File, Field, Section, Form, Group)

Parameter

Description

File

Enter the name of an external text file including any file extension. This text is appended to the field you specify.

Field

Enter the name of a field that identifies a multiline text area. This is the field that receives the appended text. The default is the current field.

Section

Enter the name of a section that contains the field you specified. The default is the current section.

Form

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

Group

Enter the name of the form group that contains the form, section, and/or field you specified. The default is the current group.

The system optionally returns one (1) on success or zero (0) on failure.

This procedure opens the external text file and appends the text from that file to the specified field. If successful, the newly inserted text is reformatted appropriately in the destination field.

If the external text file name does not include a specific path, the system tries to locate the file in the default directory where form sections are typically found.

When used with Documaker Desktop, use the Refresh procedure to make sure all appended text appears in the field.

Example

Here are some examples:

Procedure

Result

Explanation

AppendText

( "MyFile.txt")

1 or 0

The current field receives the text from the file named, MyFile.Txt. The named file does not specify a path, therefore the system tries to locate the file where form sections are normally located.

AppendText ("C:\MyFile.txt", "MyField")

1 or 0

MyField will be located on the current section. If found, the field receives the text from the file named, MyFile.Txt. The named file specifies a path, therefore the system looks for the file in that location.

AppendText

( "MyFile.txt", "MyField", , "MyForm")

1 or 0

The field, MyField, will be located on the form, MyForm. Since a section was not specified, it may occur on any section on that form. Once located, the text from the specified file is appended to the field.

See also