| REPEAT | Index Level | REPLACE |
| Syntax |
REPLACE( dynamic.array.expression, ac.expression; string.expression )
REPLACE( dynamic.array.expression, ac.expression, vc.expression; string.expression ) REPLACE( dynamic.array.expression, ac.expression, vc.expression, sc.expression, string.expression ) |
| Category | BASIC |
| Type | Function |
| Description |
inserts or replaces a specific attribute, value, or subvalue in the string referenced by "dynamic.array.expression" with the value referenced in "string.expression".
"-1" may be specified as the "ac.expression", "vc.expression", or "sc.expression". This appends "string.expression" as the last element in the respective location. If the last character of string.expression is not the correct separator, the appropriate "mark" character (attribute, value or subvalue) is inserted before the "expression" is added. Alternate method, using dynamic array reference symbols: dynamic.array.expression<ac.expression {,vc.expression {,sc.expression}> = string.expression |
| Options | |
| See Also | statements & functions string.expression array references READ ac.expression vc.expression REPLACE DEL INS functions sc.expression INSERT LOCATE array.variable EXTRACT DELETE SWAP EREPLACE |
| Example |
1) customer.item(1) = replace(customer.item(1),1,1,0,name)
-or- customer.item(1) = replace(customer.item(1),1,1;name) In this example, value 1 of attribute 1 in the first element of the dimensioned array, "customer.item", is replaced with the data value in the variable "name". This example could alternately be coded as: customer.item(1)<1,1> = name 2) string<1,-1> = value -or- string = replace(string,1,-1,0,value) -or- string = replace(string,1,-1;value) These statements add a new value at the end of attribute 1 of "string". |
| Warnings | The behavior of replace with attribute 0 is undefined and should be avoided. |
| Compatibility | D3 7.0 AP R83 |
| REPEAT | Index Level | REPLACE |