| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #ADD (add to multi-valued symbol) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ accept section valid for use .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ alias tryalias access a symbol from another instance .htm|{{btn_next_n.gif|Next page}}]] | | || **#ADD(** //symbol, expression// [, //position// ] **)** {{blk2blue.jpg|blk2blue.jpg}} | **#ADD** | Adds a new instance to a multi-valued user-defined symbol. | | //symbol// | A multi-valued user-defined symbol. | | //expression// | An expression containing the value to place in the //symbol's// instance. | | //position// | An integer constant or symbol containing the instance number to add to the //symbol//. Instance numbering begins with one (1). If the //position// is greater than the number of previously existing instances plus one, the new instance in appended and no intervening instances are instantiated. | The **#ADD** statement adds a value to a multi-valued user-defined //symbol//. An implied #FIX to that //symbol's// instance occurs. If the //symbol// is not a multi-valued user-defined symbol then a source generation error is produced. If the //symbol// has been declared with the UNIQUE attribute, then the #ADD is a union operation into the existing set of //symbol's// values. Only one instance of the value being added may exist. Also, the UNIQUE attribute implies the #ADD is a sorted insert into the existing set of //symbol's// values. After each #ADD, all of the //symbol's// values will be in sorted order. If the //symbol// has been declared without the UNIQUE attribute, duplicate values are allowed. The new value is added to the end of the list and may be a duplicate. If the //symbol// is a duplicate, then any dependent children instances are inherited. **Example:** **#DECLARE(%ProcFilesPrefix),MULTI,UNIQUE   #!Declare unique multi-valued symbol** **#FIX(%File,%Primary)                      #!Build list of all file prefiXEs in proc** **#ADD****(%ProcFilesPrefix,%FilePre)           #!Start with primary file** **#FOR(%Secondary)                          #!Then add all secondary files** **  #FIX(%File,%Secondary)** ** ****#ADD****(%ProcFilesPrefix,%FilePre)** **#ENDFOR** **See Also:** [[ declare declare a user defined symbol .htm|#DECLARE]] [[ fix fix a multi value symbol .htm|#FIX]] [[ select fix a multi value symbol .htm|#SELECT]]