TOUPPER

Contents


toupper is used to transform all the lower case letters of a character string to upper case.

 

Syntax

   toupper( expr_c )

 

Parameters

Element

Description

Restrictions

expr_c

Alphanumeric expression.

None.

 

Examples

   # Transformation of lower case to upper case;
   # This programme displays 'COCKADOODLEDOO!!!'
    Infbox toupper ("CockaDoodleDoo!!! ")

   # Compare strings (ignoring upper/lower case differences)
    If toupper (NOM_1) = toupper (NOM_2)
       Infbox "The names are identical!"
    Endif

 

Description and comments

toupper is used to transform all the lower case letters of a character string to upper case without affecting the rest of the string.

In particular, accented letters are transformed into upper case accented letters. To compare character strings independently of the accents, the ctrans function will be used, that transforms accented characters in the argument string into non-accented characters.

The result is a Char type.

 

Comments

The format$ function, associated with a format containing type 'A' characters (upper case letters) will also perform this kind of transformation, with two differences, however:

·         the length of the string obtained is fixed, however, and depends on the length of the format (spaces are added at the start, the end or at both ends, depending on the justification option chosen).

·         if different characters of a non-accented letter are found in the string to be processed, format$ will reject the formatting overall and will return a string filled with spaces.

 

Associated errors

Error

Description

ERMODE (10)

The argument is not alphanumeric.

 

Associated key words

TOLOWER - FORMAT$ - CTRANS


CONTENTS


Copyright © Sage 1999 - 2007