You are here: Function Reference > Alphabetical Listing > S > Size

Size

Use this function to return the defined length of a specified field.

Syntax

Size (Field, Section, Form, Group)

Parameter

Description

Field

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

Section

Enter the name of the 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 returns the length of the defined data area for the specified field.

The Size function is often confused with the LEN function. The LEN function returns the length of the actual data contained in a field or DAL variable.

Example

Here are some examples:

(Assume the current field contains the text Your Name and its defined length is 15.)

Function

Result

Explanation

Size ( )

15

Returns the defined length of the current field.

Size ("Myfield", , "FRM")

field size or zero

This example will look for MyField on the form, FRM. It may occur on any section. If the field is located, its size will be returned, otherwise the result is zero (0). Generally, you can assume that a zero result means the field is not defined, since it is unlikely that a field of zero length would be legitimate.

See also