Scott,
>David Fedor wrote:
>> // Macros to determine correct character code to use for drawing
>> // numeric space and horizontal ellipsis.
>> #define ChrNumericSpace(chP) do { /* much stuff */ } while (0)
>> #define ChrHorizEllipsis(chP) do { /* much stuff */ } while (0)
>
>Holy macro expansions Batman! :-)
My goal one day is to write a macro that expands into a complete Palm app...
><BORING> <NITPICKY>
>Ok, I vaguely recall you telling us at WWDC to just use a 3 dot string
>"..." instead of horizEllipsisChr to avoid all this mess. Three months
>later, is this still safe on foreign encodings such as Japanese? Or is
>the system ellipsis character preferred?
Three dots are better, and will work with all current and future character
encodings supported by the device. It's especially important to use three
dots in resources (menus, strings, etc) or any place where you can't use
the big bertha ChrHorizEllipsis macro to figure out the appropriate
character code. The one advantage to the ellipsis character is that if
you're truncating due to buffer space, it's only a single byte versus three.
>It seems it would work fine (since the '.' char is in the low ASCII
>range which is present on all encodings) but maybe three dots are not
>appropriate for the local language, if some language had a different
>symbol for continuation, for example. (Though I see the Japanese ROM
>fonts have the same old '...' ellipsis character.)
AFAIK there isn't a compelling reason to use locale-specific truncation
and/or continuation characters. Though I'm sure there are languages where
an alternative form would work better.
>Basically at this point my table draw callbacks are well tuned so I
>don't want to go back and add a parameter to pass the cached ellipsis
>character, nor can I use a global due to Global Find support, and
>obviously the new macros are cost-prohibitive for usage inside a table
>draw callback.
></NITPICKY> </BORING>
>
>(I'm obsessing about milliseconds here because the guys down the hall
>are writing the same application on Windows CE! :-)
If I had to guess, I'd say that using the macro wouldn't add a significant
amount of overhead, but the cheap, easy, and fast solution is to always use
three dots.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 650-947-9222 (direct) +1 408-261-7550 (main)