Syntax

neutralvalue = enumcode$ (tag[occ])

Arguments

neutralvalue: text

tag: database variable

occ: integer

Meaning

This function is a simplified version of enumval$: it retrieves the neutral value of the displayed value in the specified enumerative field occurrence (the field must be defined in the database setup as enumerative and the occurrence is optional: the default occurrence if none provided is 1).

Note that an enumerative field allows the user to choose a value from a fixed drop-down list. This value is presented in the current interface language. However, this is not the value which is stored in the record: that would be the neutral/standard value. Neutral values and their "translations" for display-only are specified with the enumerative field in the data dictionary.

Example

Assuming the values of enumerative field T1 are:

#0000CC (Neutral value)
Blue (Language number 0: English)
Blauw (Language number 1: Dutch)

 

#FF0000 (Neutral value)
Red (Language number 0: English)
Rood (Language number 1: Dutch)

 

#33CC00 (Neutral value)
Green (Language number 0: English)
Groen (Language number 1: Dutch)

 

With the interface language in adlwin.exe set to English, an example record has two occurrences of T1, the first displaying the value Red, the second Blue. Via ADAPL we could retrieve the neutral value of both occurrences as follows (if neutralvalue1 and neutralvalue2 have been declared as text variables):

neutralvalue1 = enumcode$(T1[1])
neutralvalue2 = enumcode$(T1[2])

Result

neutralvalue1 will be: #FF0000
neutralvalue2 will be: #0000CC