Hi Paul,
At 12:00am -0700 00-06-23, Palm Developer Forum digest wrote:
>Subject: TxtGlueCharAttr - broken?
>From: Paul Nevai <[EMAIL PROTECTED]>
>Date: Thu, 22 Jun 2000 06:11:57 -0400 (EDT)
>X-Message-Number: 11
>
>Hi:
>
>I came to the conclusion that TxtGlueCharAttr is broken whether or not it is
>used with Char or WChar. When I have macros like TxtGlueCharIsAlNum (wch) and
>run GREMLINS [OS 3.3],then POSE keeps complaining after every 3 or 4
>thousand GREMLINS,
OK, I give, what's the POSE message?
>whereas if I replace them by stuff like IsAlNum
>(GetCharAttr (), wch) then it passes millions of GREMLINS w/o any problem.
>
>Has this been observed and/or documented before?
Not that I know of.
>Am I correct about
>TxtGlueCharAttr?
No idea. One common problem is for apps to pass a Char variable to a
routine that takes a WChar parameter. If the contents of the Char
have a value > 0x7F, then the compiler will sign-extend the 8-bit
value to be a 16-bit value, so 0xC1 winds up getting passed to the
routine as 0xFFC1.
It's easy to fix by casting the Char to be a (UInt8) first. Often,
though, this is a sign of deeper problems - for example, extracting
just the low byte from the keydown event record, and then passing
that around as a Char parameter to routines.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/