basic.replace Function/BASIC Program

basic.replace

Command basic.replace Function/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
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
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)
Options
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".
Purpose
Related basic.statements
basic.string.expression
basic.array.references
basic.read
basic.ac.expression
basic.vc.expression
basic.replace.statement
basic.del
basic.ins
basic.functions
basic.sc.expression
basic.insert
basic.locate
basic.array.variable
basic.extract
basic.delete.function