basic.convert Statement/BASIC Program

basic.convert

Command basic.convert Statement/BASIC Program
Applicable release versions: AP
Category BASIC Program (486)
Description searches a given variable and replaces each occurrence of a character by another.
Any character designated in "string.expression1" is replaced with the corresponding replacement character from "string.expression2". The correspondence is by column position in "string.expression1" and "string.expression2".

If the length of "string.expression1" is shorter than the length of "string.expression2", all characters in "string.expression2" beyond the length of "string.expression1" are ignored.

If the length of "string.expression1" is longer than the length of "string.expression2", all characters in "string.expression1" beyond the length of "string.expression1" are deleted from "variable".
Syntax convert string.expression1 to string.expression2 in variable
Options
Example
convert char(254) to " " in text.string

All attribute marks are replaced with spaces in the variable 
"text.string".

equ am to char(254)
convert am to char(10) in text.item

This converts the attribute marks in "text.item" to linefeed 
characters.

x = "abc" 
convert "abc" to "d" in x  ; crt x

This outputs "d".

x = "d"
convert "d" to "abc" in x  ; crt x

This outputs "a".

x = "abba"
convert "ab" to "zm" in x  ; crt x

This outputs "zmmz".
Purpose
Related variables
basic.string.expression
basic.statements
ue.009e
basic.convertfn