Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines / Modifying Characters and Diacritical Marks


UpperString

The UpperString procedure converts any lowercase letters in a Pascal string to their uppercase equivalents. This procedure converts characters using the Macintosh file system rules, which means that only a subset of the Roman character set (character codes with values through $D8) are converted. These rules are summarized in Table 5-2 on page 5-17. Use this procedure to emulate the behavior of the Macintosh file system.

PROCEDURE UpperString (VAR theString: Str255; diacSens: Boolean);
theString
On input, this is the Pascal string to be converted. On output, this contains the string resulting from the conversion.
diacSens
A flag that indicates whether the case conversion is to strip diacritical marks. If the value of this parameter is FALSE, diacritical marks
are stripped.
DESCRIPTION
UpperString traverses the characters in theString and converts any lowercase characters with character codes in the range $0 through $D8 into their uppercase equivalents. If the diacSens flag is TRUE, diacritical marks are considered in the conversion; if it is FALSE, any diacritical marks are stripped. UpperString places the converted characters in theString.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the UpperString procedure are
Trap macroSelector
_UprString$A054

The registers on entry and exit for this routine are
Registers on entry
A0pointer to first character of string
D0the length of the string (a word value)
Registers on exit
A0pointer to first character of string

The trap macro for the UpperString procedure can take an optional argument, which changes the default setting used by the macro when it is called without arguments. This argument corresponds to the Boolean parameter diacSens that is used with the Pascal function call. The permutations of this trap macro are shown below; you must type each exactly as it is shown.

The syntax shown here applies to the MPW Assembler; if you are using another development system, be sure to consult its documentation for the proper syntax.
Macro permutation
Value of diacSens
_UprStringTRUE
_UprString ,MARKSFALSE


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996