Summary:

Trying to use TxtGlueCharIsDigit, TxtGlueCharIsLower, TxtGlueCharIsPunct,
TxtGlueCharIsUpper, TxtGlueCharIsHex give compile-time errors.


Environment:
    Mac OS 9.1, Codewarrior R7 for Palm OS, Palm OS 4.0 SDK

Reproduce:
Using TxtGlueCharIsDigit(ch) in a .c file gives error:
> Error   : undefined identifier '_DI'
> Order.c line 552   ((TxtGlueCharAttr(c) & _DI) != 0)
> 


In the 4.0 SDK (final), TxtGlue contains the following definitions:
> #define TxtGlueCharIsSpace(ch)        ((TxtGlueCharAttr(ch) & charAttrSpace)
!= 0)
> #define TxtGlueCharIsPrint(ch)        ((TxtGlueCharAttr(ch) & charAttrPrint)
!= 0)
> #define TxtGlueCharIsDigit(ch)        ((TxtGlueCharAttr(ch) & _DI) != 0)
> #define TxtGlueCharIsAlNum(ch)        ((TxtGlueCharAttr(ch) & charAttrAlNum)
!= 0)
> #define TxtGlueCharIsAlpha(ch)        ((TxtGlueCharAttr(ch) & charAttrAlpha)
!= 0)
> #define TxtGlueCharIsCntrl(ch)        ((TxtGlueCharAttr(ch) & charAttrCntrl)
!= 0)
> #define TxtGlueCharIsGraph(ch)        ((TxtGlueCharAttr(ch) & charAttrGraph)
!= 0)
> #define TxtGlueCharIsLower(ch)        ((TxtGlueCharAttr(ch) & _LO) != 0)
> #define TxtGlueCharIsPunct(ch)        ((TxtGlueCharAttr(ch) & _PU) != 0)
> #define TxtGlueCharIsUpper(ch)        ((TxtGlueCharAttr(ch) & _UP) != 0)
> #define TxtGlueCharIsHex(ch)            ((TxtGlueCharAttr(ch) & _XD) != 0)
> #define TxtGlueCharIsDelim(ch)        ((TxtGlueCharAttr(ch) & charAttrDelim)
!= 0)

However, although TextMgr.h defines the constants beginning with charAttr
(charAttrAlpha, charAttrCntrl, etc.), it doesn't define the constants
beginning with _ (_LO, _PU, etc.). Instead those are named charAttr_LO,
charAttr_PU, etc.).

Solution:
Change TxtGlue.h to add charAttr before each of the uses of the _XX
constants.

Workaround:
My need was for TxtGlueCharIsDigit. I'm going to go ahead and use:
    TxtGlueCharIsAlNum(ch) && !TxtGlueCharIsAlpha(ch)


Neil

P.S. Was there a palmos.com page at which to report bugs? If so, where is
it?

-- 
Neil Rhodes     
[EMAIL PROTECTED]            Available for contract programming
Coauthor: Palm Programming: the Developer's Guide (O'Reilly)




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to