At 12:00am -0700 00-08-22, Palm Developer Forum digest wrote:
>Subject: Month names
>From: Richard Bram <[EMAIL PROTECTED]>
>Date: Fri, 18 Aug 2000 23:19:27 -0500
>X-Message-Number: 101
>
>According to the OS3.5 headers, we shouldn't use monthNamesStrID
> anymore because it is "OBSOLETE - use monthNamesStdStrListID"
>But, when I try to get a 'tSTR' resource of ID monthNamesStdStrListID
>on the Emulator with OS3.5 ROM, it returns 0. AND monthNamesStrID
>still works.
1. As the name suggests, "monthNamesStdStrListID" is a string list
resource (tSTL), not a string resource (tSTR).
2. If you're running on OS 3.5 or later, then you can call the new
DateTemplateToAscii routine to get the month name in a safe manner
without grabbing system resources. For example, if you want the
standard month name (e.g. "Jan") then you would use:
DateTemplateToAscii( "^2r", // Template string = 2 (month), r (regular)
january,
1, // days (don't care)
2000, // years (don't care)
resultStr,
sizeof(resultStr));
To get "January", use "^2l" for the template string.
3. Currently there's no DateGlueTemplateToAscii, so you're stuck with
parsing the old string resource on pre-3.5 ROMs, but I'll add that to
PalmOSGlue.lib if I get some time.
>Does it seem likely that monthNamesStrID will continue to work in
>future ROMs for a while, then?
No, it will stop working soon.
>And by the way, is there a built-in function to extract a given
>word from a string list (space demarcated)?
No, and hopefully the need to parse the Palm OS string resources will
go away as the API matures.
-- 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/