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:
![](../../picture/1350179/pict1350179.en.png)
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:
- Save as Value (default option): the value of the item chosen in the list by the user is saved directly. For example, if the user chooses the value "Blue", then this value is saved in the field.
- Save as Reference: the reference of the choice list item is saved in the object. This reference is the numeric value associated with each item either through the itemRef parameter of the APPEND TO LIST or SET LIST ITEM commands, or in the lists editor (see Adding a reference to an item).
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:
- To be able to store the reference, the field or variable must be of the Number type (regardless of the type of value displayed in the list).
- Valid and unique references must be associated with list items.
- If you enable this option for a pop-up menu, it must be associated with a field (see Using a choice list).
- This option is compatible with choice lists defined in the structure. In this case, you can just select the option in each form where the listed field is used.
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:
![](../../picture/1350217/pict1350217.en.png)
During input, you can select a value in the pop-up menu and it is displayed corrected in both objects:
![](../../picture/1350219/pict1350219.en.png)
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).
![](../../picture/1350221/pict1350221.en.png)
You can set up the output form on the same principle: you select the Reference option for saving the Title field:
![](../../picture/1350229/pict1350229.en.png)
During execution, the value is correctly displayed:
![](../../picture/1350231/pict1350231.en.png)