Functions and Directives

Function Upper() Foundation

Converts lower case letters in a character string to upper case.

Syntax
Upper( <cString> ) --> cUpperCase
Parameters
<cString>
<cString> is a character string which is converted into uppercase letters.
Return

The return value of Upper() is a copy of <cString> in which all lower case letters are replaced with upper case letters.

Description

The character function Upper() converts all lower case letters in a character string to upper case. It is the reverse of the function Lower() which converts character strings to lower case.

The letters "a" to "z" are converted by Upper() to "A" to "Z". To convert language-specific special characters like " ", " " and " " to upper case letters, the appropriate collation table must be selected.

The result depends on SET COLLATION and can be manipulated by LocaleConfigure() .

Examples
Upper()
// The example shows various results of the function Upper() 

PROCEDURE Main 

   ? Upper("Xbase++")               // result: XBASE++ 
   ? "XBASE++" == Upper("Xbase++")  // result: .T. 

RETURN 
Create an index using Upper()
// In the example, an index is created independent of the 
// case of the text. 

PROCEDURE Main 
   LOCAL cName:= Space(20) 

   USE Address NEW EXCLUSIVE 
   INDEX ON Upper(Name) TO Address1 

   @ 10,10 SAY "Name:" GET cName 
   READ 

   SEEK Upper(cName) 

   ? IIf( Found(), "Found", "Name does not exist" ) 

   USE 
RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.