>It has been brought to my attention that the Palm OS Reference talks about
>maxDateTemplateLen in the description of DateTemplateToAscii(), but
>maxDateTemplateLen is never defined in the SDK.
>
>This seems to be a bug in the includes, which we'll correct in the next big
>SDK release.

Actually it's a bug in the docs; I don't think they should say 
anything about this constant. The maxDateTemplateLen limit is only 
for internal system date format specification strings. There is no 
such limit in what you pass to DateTemplateToAscii.

>For the record, and for the forum archives in case people
>search for it...
>
>// Max length of any date template string (before expansion), excluding the
>null.
>#define maxDateTemplateLen 31

This is the internal limit on the template length _before_ expansion. 
The maximum resulting lengths for any system date strings are bounded 
by the constants already defined in DateTime.h:

#define dateStringLength        9       // short date formats
#define longDateStrLength       15      // med/long date formats
#define dowDateStringLength     19      // short date formats + DOW name
#define dowLongDateStrLength    25      // med/long date formats + DOW name

Of course you can pass whatever template you like to 
DateTemplateToAscii, even if it's longer than 31 bytes. So you can 
exceed these limits in your own code, but note that the stringLen 
parameter to DateTemplateToAscii is there to protect you from buffer 
overruns.

-- 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/

Reply via email to