MAINSAIL Language Manual, Section 32.96

previous   next   top   contents   index   framed top   this page unframed


32.96. cvu

Figure 32–109. cvu (GENERIC)
$BUILTIN
INTEGER
PROCEDURE   cvu         (INTEGER char);

COMPILETIME
STRING
PROCEDURE   cvu         (STRING s;
                         
OPTIONAL POINTER($areaarea);

cvu converts a character or STRING to upper case.

The STRING form converts a STRING to all upper case (i.e., the lowercase letters a through z are converted to the corresponding uppercase letters A through Z, and other characters are unchanged). area specifies the destination area for the resulting STRING if new STRING text is generated; see Section 29.4.

If char is the code of a lowercase letter, then the INTEGER form returns the code of the corresponding uppercase letter. Otherwise, cvu(char) is equal to char.

Example 32–110. Use of cvu
cvu("aBc") = "ABC"
cvu("a2$") = "A2$"
cvu('a')   = 'A'
cvu('M')   = 'M'

If r and s are STRING variables, then:

IF cvu(r) = cvu(sTHEN ...
IF cvu(r) < cvu(sTHEN ...

are more efficiently written as:

IF equ(r,u,upperCaseTHEN ...
IF compare(r,u,upperCase) < 0 THEN ...

previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 32.96