The convert() function searches a given variable and replaces each occurrence of a character by another.
result = convert(var, str.exp1, str.exp2)
var | Variable in which the specified string will be searched and replaced. |
str.exp1 | Specifies the characters to be replaced with the corresponding replacement characters from str.exp2. |
str.exp2 | Specifies the characters to replace the characters specified in str.exp1. |
The original string is not modified unless it is also specified as the result string.
Any character designated in str.exp1 is replaced with the corresponding replacement character from str.exp2. The correspondence is by column position in str.exp1 and str.exp2.
* convert commas to attribute marks var = "a,b,c" str.exp1 = "," str.exp2 = @AM result = convert( var, str.exp1, str.exp2 ) crt "var = " : var crt "result = " : result
* convert commas to dots, and dots to commas var = "12,345,678.90" str.exp1 = ",." str.exp2 = ".," result = convert( var, str.exp1, str.exp2 ) crt "var = " : var crt "result = " : result