Dela via


SCATTER NAME...ADDITIVE Sample

File: ...\Samples\Solution\Toledo\ScatterName.scx

This sample demonstrates how to update and saves some form properties from and to a table using the SCATTER command with the NAME and ADDITIVE clauses and the GATHER command with the NAME clause.

In this sample, you can update an existing object with values from the current record using the ADDITIVE clause with SCATTER NAME. You can then change the color, resize, move, or minimize the form, and close it. When you run the form again, it appears with the color, size, location, and previous state from when it was closed.

For more information, see GATHER Command and SCATTER Command.

Setting Form Properties from a Table Using SCATTER...NAME... ADDITIVE

In this sample, the following code in the form's Init event opens a table and sets the form's properties from matching fields in the table as shown:

USE (ThisForm.cRunPath+"FormProps")
SCATTER NAME ThisForm ADDITIVE
USE IN FormProps

The ADDITIVE keyword makes it possible to update and add object properties.

Saving Form Properties to a Table Using GATHER NAME

In this sample, when the form closes, the property values are saved in the matching fields of the table, which occurs in the form's Destroy event.

USE (ThisForm.cRunPath+"FormProps")
GATHER NAME ThisForm
USE IN FormProps

Note   This table is created in a database so that the lengths of the fields can be longer than 10 characters.

See Also

Solutions Samples