Syntax

translation = enumval$ (source_text, tag, language_number)

Arguments

translation, source_text: text

tag: database variable

language_number: integer

Meaning

This function "translates" a source_text which must appear in the tag tag (the field must be defined in the database setup as enumerative) into the corresponding text in the language with the number language number.This can only be done if for the requested language the translation is already present in the tag tag. The result is placed in the variable translation. The translation will be an empty string if no corresponding value is found.

In a record, in this field only the language number is stored.

The standard text for the field in this record can be read using language number -1.

Example

Assuming the texts of field T1 are:

#FF0000 (Language-independent value)
Red (Language number 0: English)
Rood (Language number 1: Dutch)
Rouge (Language number 2: French)
Rot (Language number 3: German)

translation1 = enumval$('Purple', T1, -1)
translation2 = enumval$('Rot', T1, 0)
translation3 = enumval$('Rot', T1, 3)
translation4 = enumval$('Rot', T1, -1)
translation5 = enumval$('Rot', T1, 4)
translation6 = enumval$('Rot', T2, -1)

Result

translation1 will be: '', because Purple does not occur in T1.
translation2 will be: Red.
translation3 will be: Rot.
translation4 will be: #FF0000.
translation5 will be: '', because no value is filled in for language number 4 in T1.
translation6 will be: '', because Red does not occur in T2.