4D v16.3Save as Value or Reference |
||
|
4D v16.3
Save as Value or Reference
Save as Value or Reference
The Save as Value/Reference option is found in the "Data Source" theme for Field and variable objects as well as Pop-up Menus/Drop-down Lists: This option specifies, in the context of a field or variable associated with a list of values (choice list), the type of contents to save in the field:
This option lets you optimize memory usage: storing numeric values in fields uses less space than storing strings. It also makes it easier to translate applications: you just create multiple lists in different languages but with the same item references, then load the list based on the language of the application. Using the Save as Reference option requires compliance with the following principles:
You want to use a "Title" field to characterize people: Mr, Ms, but also Dr, Mgr, Hon, and so on. To do this, you create a longint type field named "Title". You define a choice list (named "Titles") containing all the possible titles, then you associate it with the field. In the input form, we show the "Title" field twice in order to illustrate the mechanism implemented: once as a pop-up and once as an entry area. Both objects are associated with the same choice list and the data is saved as a reference:
During input, you can select a value in the pop-up menu and it is displayed corrected in both objects: Note: In this form, the "List" window is displayed when the entry area has the focus. If you no longer want to show this window, you can just use a pop-up menu for input and display of the values. (see Pop-up Menus/Drop-down Lists). You can set up the output form on the same principle: you select the Reference option for saving the Title field:
During execution, the value is correctly displayed:
|
PROPERTIES
Product: 4D
HISTORY
ARTICLE USAGE
4D Design Reference ( 4D v16) |