text_block_exists
The function text_block_exists tests if a Text Block exists in the KCM Designer and has a revision that can be used in a Master Template.
text_block_exists (text_block;reserved)
The function text_block_exists is of type BOOL.
The function has two parameters:
- The parameter text_block is of type TEXT. This is the name of the Text Block which is searched for in KCM Designer.
- The parameter reserved is of type NUMBER. This parameter is reserved for future use and must always be set to 0.
The function text_block_exists returns TRUE if the Text Block exists in KCM Designer and has a suitable revision that can be used in a Master Template. The function returns FALSE if the Text Block does not exist or if there is no such revision.
An example is provided here.
TEXT block := "BuildingBlocks\" + Customer.Language + "\Salutation"
IF text_block_exists (block; 0) THEN
TEXTBLOCK
NAME block
ELSE
TEXTBLOCK
NAME "BuildingBlocks\ENG\Salutation"
FI
The preceding example shows how a Text Block 'Salutation' based on the language contained in the Customer.Language Field. If no Text Block is available for this language, it defaults to the language 'ENG'.