formulafill
FORMULA

The formulafill statement fills every visible cell in the active field with the result of the specified formula.


Parameters

This statement has one parameter:

formula – can be a literal value, a field or a variable, or an expression that returns the value you wish to put into the cells of the current field. The resulting value must match the type and format (if any) of the field you are placing it in or an error will result.


Description

The formulafill statement fills every visible cell in the active field with the result of the specified formula. This statement evaluates the formula and if it is compatible with the current field type, writes its result to every cell in that field for all selected records only.

Warning: If a cell already contains a value, formulafill will replace that value with the new one.

This simple example tells Panorama to clear all the selected cells of the active field. Therefore, the active field should be a text or choice type field.

formulafill ""

This similar example works for numeric or date type fields.

formulafill zeroblank(0)

This example tells Panorama to look at all the selected cells of the field Options and only fill the empty ones with the text string n/a.

field Options
formulafill ?(Options = "","n/a",Options)

This example alters the area code for the selected records in the numeric field Phone Number from 213 to 310.

field "PhoneNumber"
select strip(PhoneNumber) beginswith "213"
formulafill val("310"+str(PhoneNumber)[4,-1])

This example uses a formula to fill the visible cells in the field RenewalDate with a date that is one year beyond the computer’s current date. The final date will be the 1st of the month.

field RenewalDate
formulafill datepattern( month1st( today() +  365),"mm/dd/yy")

Note: When combined with the fillall statement, the formulafill statement can modify invisible records as well as visible records. See the fillall statement for details.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but no longer supports the *dialog* parameter. Can now be combined with the FillAll statement to fill both visible and invisible records.