GetStoredFormat function

Syntax

GetStoredFormat(scrollpath, target_row, [recordname.]fieldname)

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can also use SCROLL.scrollname, where scrollname is the same as the scroll level’s primary record name.

Description

Use the GetStoredFormat function to return the name of a field’s custom stored format.

Note:

This function remains for backward compatibility only. Use the StoredFormat field class property instead.

To return the format for a field on level zero of the page, pass 1 in target_row.

Parameters

Parameter Description

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

An integer specifying the row of the target field. If you are testing a field on level zero, pass 1 in this parameter.

[recordname .]fieldname

The name of the field from which to get the stored format name. The field can be on any level of the active page. The recordname prefix is required if the call to GetStoredFormat is not on the record definition recordname.

Returns

Returns a String equal to the name of the stored custom format for the field.

Example

This example returns a string containing the custom format for postal codes on level zero of the page or on the current row of scroll level one. This function is called in the RowInit event, so no looping is necessary.

Function get_postal_format() Returns string
   &CURR_LEVEL = CurrentLevelNumber();
   Evaluate &CURR_LEVEL
   When = 0
      &FORMAT = GetStoredFormat(POSTAL, 1);
   When = 1
      &FORMAT = GetStoredFormat(POSTAL, CurrentRowNumber(1));
   End-Evaluate;
   Return (&FORMAT);
End-Function;