CONVERTING
Syntax
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
INSPECT (<Variable>)
CONVERTING (<Old values>, <New values>[, <Condition>, <Value>])
ENDINSPECT
Description
This command replaces the separate characters specified in the string <Old values> with the corresponding characters in the <New values> string when found in the variable to inspect. I.e. the first character in the <Old values> string will be replaced by the first character in the <New values> string, the second character in the <Old values> string with the second character in the <New values> string and so on.
When a BEFORE or AFTER condition has been specified the converting will either stop at the occurrence of <Value> in <Variable> or start directly after the occurrence of <Value> in <Variable> and continue till the end of <Variable>.
Diagram

Returned value type
None
Parameters
| Parameter | Description | |
| <Variable> | The variable to inspect | |
| <Old values> | The string with characters to search seperately in <Variable> and to be replace by the corresponding character in the <New values> string. | |
| <New values> | The string with characters to replace the corresponing characters in the <Old values> string. | |
| <Condition> | BEFORE | Specifies a BEFORE condition. I.e. the converting will start at the beginning of <Variable> and stop at the occurrence of <Value> in <Variable>. |
| AFTER | Specifies an AFTER condition. I.e. the converting will start directly after the occurrence of <Value> in <Variable> and continue till the end of <Variable>. | |
| <Value> | The start/stop character or string to use for the BEFORE or AFTER condition. | |
Example
va-inspect := '**AB**CD**EF'
inspect (va-inspect)
converting ('AC*', 'zla')
endinspect
// va-inspect is 'aazBaalDaaEF'
(B)
va-inspect := '**AB**CD**EF'
inspect (va-inspect)
converting ('AC*', 'zla', before, 'D')
endinspect
// va-inspect is 'aazBaalD**EF'
(C)
va-inspect := '**AB**CD**EF'
inspect (va-inspect)
converting ('AC*', 'zla', after, 'B')
endinspect
// va-inspect is '**ABaalDaaEF'
