ADELIA |
VADELIA |
SADELIA |
WADELIA |
EADELIA |
(I/B) |
(I/B) |
(B) |
(I/B) |
(B) |
Description
This predefined function is used to extract 'n' characters from a string, starting from a given position.
Syntax
Result = &SUBSTRING(String;Beginning;Length)
Parameters
Description |
Contents |
Controls |
|
Result |
Alphanumeric |
Resulting substring. The result field is cleared before the function is run. |
|
String |
Alphanumeric constant or variable. |
Character string from which the substring is to be performed. |
Mandatory parameter. |
Beginning |
Numeric integer constant or variable. |
Beginning position in the string specified as a parameter This position must be greater than zero and smaller than the length of the substring. |
Mandatory parameter. |
Length |
Numeric integer constant or variable of length <= 5. |
Number of characters to be extracted. |
Mandatory parameter. |
Note: If the following rule is not complied with, the function execution fails and the result field remains unchanged.
Length <= length (String) - Beginning + 1.
Example
STRING = 'MRS SIMSON KATHIE '
BEGIN = 5
LENGTH = 20
RESULT = &SUBSTRING(STRING;BEGIN;LENGTH)
* The RESULT is equal to: SIMSON°KATHIE°°°°°°
*
STRING = 'THE YELLOW SUBMARINE'
RESULT = &SUBSTRING(STRING;5;20)
* The RESULT is equal to: YELLOW°SUBMARINE°°°
List of predefined functions by topic