RIGHT$ |
right$ is used to extract a right sub-string starting from a particular position in a character string.
right$( string, position )
|
Element |
Description |
Restrictions |
|
string |
Alphanumeric expression |
None. |
|
position |
Numerical integer expression for the position extraction begins. |
position >= 0 |
# Extraction of alphabet from the 4th letter # This programme displays "DEFGHIJKLMNOPQRSTUVWXYZ" ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"Infbox right$(ALPHABET, 4)
# Extraction of last NB characters from a string
Infbox right$(CHAINE, 1 + len(CHAINE) - NB)
La fonction right$(string, position) extracts the characters of the string from the position up to the end.
The result is a Char type.
· If position is greater than the length of the string, right$(string, position) returns the empty string "" and no error is generated,
· if position is equal to 0 or 1, right$(string, position) returns string.
|
Error |
Description |
|
ERMODE (10) |
The arguments are not of the corresponding type. |
|
ERDOM (50) |
Length of truncation negative. |
|
|