CONVERT

CONVERT


conv.expression Index Level CONVERT
Syntax CONVERT string.expression1 TO string.expression2 IN variable
Category BASIC
Type Statement
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.expression2" are deleted from "variable".
Options
See Also variables string.expression statements & functions u009e CONVERT
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".
Warnings
Compatibility D3 7.0 AP
conv.expression Index Level CONVERT