INSPECT...ENDINSPECT
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
INSPECT (<Variable>)
<Suboption(s)>
ENDINSPECT
Description
This command allows the inspection of the contents of a variable. The contents can be inspected in three ways (suboptions):
- Counting: characters in the variable can be counted in various ways
- Converting: characters in the variable can be replaced by different characters.
- Replacing: characters in the variable can be replaced by different characters.
The difference between converting and replacing is in the way the characters to replace are presented. In CONVERTING the characters to replace are specified in a string and are to be replaced by characters specified in a second string. In REPLACING the characters or strings to replace are specified as (an array of) individual characters or strings and are te be replaced by characters or strings also specified as (an array of) individual characters or strings.
Remarks
It is allowed to use more than one suboption in a single INSPECT command. The order of execution is the order the suboptions are written in the code. The example shown below is a valid INSPECT command.
Example
inspect (va-inspect)
counting (result, all, '*') // result will be 6
converting ('AC*', 'zla') // va-inspect will be 'aazBaalDaaEF'
replacing (all, 'a', 'z') // va-inspect will be 'zzzBzzIDzzEF'
endinspect
Suboptions