| Syntax Color Legend |
|---|
| Command |
| Mandatory parameter |
| Optional parameter |
| Mandatory keyword |
| Optional keyword |
<Variable> := LENGTH (<String>)
Returns the length of the specified text in <String>.
Integer
| Parameter | Description |
|---|---|
| <Variable> | The variable that will be set to the length of the string . |
| <String> | An expression giving the string or realstring value to measure the length of. |
The string variable <String> can also be represented by a realstring variable an alpha variable or a literal string.
When calculating the length of an alpha variable the leading spaces are counted and the trailing spaces are skipped (see the example below).
var
n-townlength : numeric 2
n-countrylength : numeric 2
n-combinedlength : numeric 2
a-town : alpha 20 value ' Coevorden'
a-country : alpha 20 value 'Netherlands'
begin_routine
n-townlength := length (a-town)
n-countrylength := length (a-country)
n-combinedlength := length (a-town + a-country)
end_routine
// Results:
// n-townlength = 10
// n-countrylength = 11
// n-combinedlength = 21