NGrant.com wrote:
Well, you would use that series of commands to do the whole thing, not just replace VNStrCopy.NGrant.com wrote:
Hi Bob,
Thanks for your very prompt reply & I dont even have Dr in the front of my name :)
You have to help me out, your reply has gone right over my head.
I dont understand !!!!!!!
How can I use TimGetSeconds, TimSecondsToDateTime, TimeToAscii to replace
VNStrCopy ?
TimGetSeconds() returns the current time; the number of seconds since Jan1, 1904. Not too usable in that state.
TimSecondsToDateTime() converts that big number into a structure so that you can use the parts more conveniently.
TimToAscii() takes a couple of those parts and converts them to a formatted string.
So you would do it like this (off the top of my head -- might have to clean up a little):
void DrawTime(void)
{
UInt32 now;
DateTimeType dt;
char *st=MemPtrNew(timeStringLength); //you might want this bigger if you intend to add any extra text to the string.
now=TimGetSeconds();
TimSecondsToDateTime(now,&dt);
TimToAscii(dt.hour, dt.minute, tfColonAMPM, st); //use whatever format you want (the 3rd parameter) or, better yet, use the system time format setting.
WinDrawChars(st, StrLen(st),0,0);
MemPtrFree(st);
}
This should draw the current time at the top-left corner of your screen.
Bob.
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
