2022.2

Table Of Contents
Add2(const String Name, const String Value, TAddFlags Flags, Integer Index (optional))
Fields only
Adds a new field to the collection. The behavior of the method when the specified name already exists
in the collection is determined by the Flags argument.
Parameters
Name
Name of the field to add. The name must adhere to this syntax rules: start with a letter, followed by
zero or more letters, numbers, underscore or dash. The name is not case-sensitive.
Value
Value of the element. There is no restriction on the content, although binary is discouraged.
Flags
Additional flags for the method. This determines how the method behaves when the specified name
already exists.
afReplace 0 Overwrites the previous value with the new
afAppend 1 Appends the new value at the end of the previous one
afDuplicate 2 Creates a new field with the same name
afFail 3 Raise an error
Note: In an Active Script environment, such as the Run Script task, you must use the numerical
value, since the TAddFlags type is not defined in an Active Script environment.
Index (optional)
Instance of the field to modify. This must be a numeric value equal to 0 or greater and can only be
used with the afReplace flag.
Exceptions
l
EOleException The name is empty or invalid.
l
EOleException The flags value is invalid.
l
EOleException The name already exists and the afFail flag was specified.
l
EOleException The index is invalid.
l
EOleException An index is specified but afReplace is not specified.
CountByName(const String Name)
Returns the number of attributes or fields (integer) with the specified name.
Page 187