A few comments on this code...

At 12:00am -0800 00-11-07, Palm Developer Forum digest wrote:
>Subject: Re: Get system date
>From: "M. Edward Wilborne III" <[EMAIL PROTECTED]>
>Date: Mon, 6 Nov 2000 08:02:07 -0500
>X-Message-Number: 17
>
>Thanks!
>
>You can also use:
>
>...
>DateToAscii(ct.month,ct.day,ct.year,
>(DateFormatType)PrefGetPreference(prefLongDateFormat),Currentdate);

In this case the CurrentDate variable needs to be defined as

Char CurrentDate[longDateStrLength+1];

>...
>TimeToAscii( ct.hour, ct.minute,
>(TimeFormatType)PrefGetPreference(prefTimeFormat), Currenttime);
>...
>
>To get the time formatted in the system defined preferences for how they
>like the date and time displayed.
>
>I get the impression that this code:
>
>      SystemPreferencesType sysPrefs;
>      // Get system preferences
>
>      PrefGetPreferences(&sysPrefs);

Avoid using PrefGetPreferences() - use PrefGetPreference(selector) 
instead. The structure returned by PrefGetPreferences() has to be a 
fixed size, so that older code won't croak on newer ROMs, which means 
that new preferences can't get added to it.

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