RIGHT$

Contents


right$ is used to extract a right sub-string starting from a particular position in a character string.

 

Syntax

   right$( string, position )

 

Parameters

Element

Description

Restrictions

string

Alphanumeric expression

None.

position

Numerical integer expression for the position extraction begins.

position >= 0

 

Examples

   # 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)

 

Description and comments

La fonction right$(string, position) extracts the characters of the string from the position up to the end.

The result is a Char type.

 

Comments

·         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.

 

Associated errors

Error

Description

ERMODE (10)

The arguments are not of the corresponding type.

ERDOM (50)

Length of truncation negative.

 

Associated key words

LEN - MID$ - LEFT$ - SEG$


CONTENTS


Copyright © Sage 1999 - 2007