Microsoft KB Archive/47986
Article ID: 47986
Article Last Modified on 1/9/2003
- Microsoft QuickBasic Compiler for Macintosh 1.0
This article was previously published under Q47986
This article describes how to display special characters on the Macintosh using the CHR$ function, or using the OPTION or SHIFT+OPTION keys to embed characters into quoted strings. You can use special symbols, as well as characters from international alphabets with accents and diacritical marks.
This information applies to Microsoft QuickBASIC version 1.00 for the Apple Macintosh.
The Apple Macintosh System offers several methods to generate special characters. QuickBASIC can take advantage of the special Macintosh characters as follows:
Below are four special symbols assigned to ASCII values 17 through 20, available in TEXTFONT 0. These are detailed on Page I-220 of "Inside Macintosh" Volume I (by Apple Computer, published by Addison-Wesley, 1985):
Symbol Character Code ------ -------------- commandMark 17 (COMMAND key symbol) checkMark 18 (Check mark) diamondMark 19 (Filled-diamond symbol) appleMark 20 (Apple symbol)
The following program displays these symbols:
TEXTFONT 0 FOR x = 17 TO 20 PRINT CHR$(x) NEXT
The following program uses the CHR$ function to display the special Macintosh characters assigned to extended ASCII values 128 through 216, which include miscellaneous symbols and Greek and foreign-language characters:
WIDTH 40 ' Changes screen width to wrap at 40 characters. FOR x = 128 to 216 PRINT CHR$(x); NEXT WIDTH 255 ' Changes screen back to no automatic wrapping.
Note that standard ASCII characters are values 32 through 126.
You can also hold down OPTION or SHIFT+OPTION and type special symbols into quoted strings or REMarks. (For a map of these characters, select Key Caps from the Apple menu, and press the OPTION key alone, or the SHIFT and OPTION keys together.) Example:
A$ = "Hold down OPTION or SHIFT+OPTION and type: <option-chars>" PRINT A$ ' PRINT the characters to the output window.
- The OPTION key can also be used in a two-character sequence to enter the accents or diacritical marks for international language characters. You may type these characters into quoted strings or REMarks. [If a character cannot be accented by the mark you've chosen, you get the mark, followed by the character. Typing the OPTION+key combination followed by a space gives you the diacritical mark alone. Many capital letters don't support accents or diacritical marks on the Macintosh.]:
For a grave accent (`), type OPTION+` then type the vowel you want to accent (a, e, i, o, u).
For an acute accent (which slants the opposite of a grave accent), type OPTION+e then type the vowel you want to accent (a, e, i, o, u).
For a circumflex (^), type OPTION+i then type the vowel you want to accent (a, e, i, o, u).
For the diacritical mark for an umlaut vowel, type OPTION+u then type the character you want to accent (a, e, i, o, u).
For a tilde (~) over an n, type OPTION+n then type the character n.
For a c with a cedilla, type OPTION+c.
Additional query words: MQuickB