You are here: Function Reference > Alphabetical Listing > F > FieldFormat

FieldFormat

Use this function to return the format string associated with the field’s type.

Syntax

FieldFormat (Field, Section, Form, Group)

Parameter

Description

Field

Enter the name of a field. The default is the name of the current field.

Section

Enter the name of the section that contains the field you specified in the Field parameter. The default is the current section.

Form

Enter the name of the 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.

Certain field types (like date and numeric data types) will sometimes have additional format information specified. Typically, a user will not be concerned with this type since the fields are designed appropriately for data entry. However, a script may be written that does not assume the field’s format and must query the information to be accurate.

The value returned from this function is a string. If a field cannot be located matching the specified information, an empty string will be returned.

Example

Here are some examples:

Function

Result

Explanation

Return(FieldFormat ( "First"))

ZZ9.99

Locate the field and return its format. This example assumes that the field was a numeric type with a format of ZZ9.99.

Return(FieldFormat ( "Second"))

 

This example returns an empty string. This either means the field has no format string or could not be located.

Return(FieldFormat ( "Third", , "FRM"))

1/4

Locate the form specified within the current form group. Then locate Third anywhere on that form. If found, the field’s format is returned which may be an empty string. This example returned a format "1/4" which is a particular date format.

See also