I hope u r not updating the database file Date.txt while closing the
application or closing the form .etc..
----- Original Message -----
From: quennie <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: Palm Developer Forum <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 4:15 PM
Subject: The existing date is not similar to the previous date of the file
stream
> The following code is the file stream created during the launching
> application. For the 1st launching, a current date will be written to a
> file. For the following launching, the current date will be compared with
> the previous date through the file created. Now my problem is that, the
> date1.day for the file stream is 25. But when the "lid!=0 ", the date1.day
> of the file stream(Date.txt) become 26 (i tested it on the same day). How
> come like this???
>
> LocalID lid;
> lid = DmFindDatabase(0, "Date.txt");
>
> DateType date, date1;
>
> GetDate(&date);
>
> if (lid == 0)
> {
> GetDate(&date1);
>
> fileHandle = FileOpen (0, "Date.txt", 0,0, fileModeReadWrite, &error);
> FileWrite(fileHandle, &date1, dateStringLength, 1, &error );
>
> FileClose(fileHandle);
> }
>
> if (lid != 0)
> {
>
> fileHandle = FileOpen (0, "Date.txt", 0,0, fileModeReadWrite, &error);
> FileRewind(fileHandle);
>
> FileRead (fileHandle, &date1, dateStringLength, 1,&error1);
>
> if ((date1.day)!=date.day)
> {
>
> --- but seems the date1.day is 26 but the date.day is 25. I tested it on
the
> same day.
>
> }
>
>
>
> Do you have any idea??? pls help. Thank you in advance.
>
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/