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:
$(keyname)
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:
OK := paSetKey (NAME, VALUE)
Parameters:
NAME : STRING; | Name of the variable keyword |
VALUE : STRING; | Value of the variable keyword |
OK | TRUE if successful |
Description:
This function defines the value of a defined keyword to be replaced when copying a template.
Example:
Template ST program:
if
ALARM_$(ALM) then
bMainAlarm := TRUE;
end_if;
Script instructions:
paSetKey
('ALM', 'Engine2')
paTplCopySource ('TargetProgram',
'TemplateName');
Generated ST program:
if
ALARM_Engine2 then
bMainAlarm := TRUE;
end_if;
OK := paRemoveKeys ()
Parameters:
OK | TRUE if successful |
Description:
This function removes all values defined for variable keywords used for copying templates.