basic.replace
Replaces element in string expression.
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)
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
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'.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
