Variable keywords for copying templates

Your scripts can contain template documents to be copied in the target project. When copying documents, some special keywords may be variables defined from the script and replaced by the value given by the script.

Use the following syntax in your templates for specifying variable keywords:


and use the following functions in your script to set values for keywords:

paSetKey - Define the value of a variable keyword
paRemoveKeys - Reset values of all defined variable keywords

Below is detialed information about these functions:

paSetKey - Define a variable keyword for copying templates

OK := paSetKey (NAME, VALUE)


NAME : STRING; Name of the variable keyword
VALUE : STRING; Value of the variable keyword
OK TRUE if successful


This function defines the value of a defined keyword to be replaced when copying a template.


    Template ST program:

    if ALARM_$(ALM) then
        bMainAlarm := TRUE;

    Script instructions:

    paSetKey ('ALM', 'Engine2')
    paTplCopySource ('TargetProgram', 'TemplateName');

    Generated ST program:

    if ALARM_Engine2 then
        bMainAlarm := TRUE;

paRemoveKeys - Remove all values defined for template variable keywords

OK := paRemoveKeys ()


OK TRUE if successful


This function removes all values defined for variable keywords used for copying templates.