Richard,
    The following lines in your source appear incorrect ..
>
>   DmSet(recP, (ULong)recP->DriverLogRec.PeriodTimestamp.hour,
sizeof(ULong),
> clickHour);
>   DmSet(recP, (ULong)recP->DriverLogRec.PeriodTimestamp.minute,
> sizeof(ULong), clickMin);
>

DmSet() and DmWrite() expect the 2nd parameter to be an offset into the
record.
The above code will not work since you treat the 2nd parameter as the Hour
value (perhaps you meant &recP...), but instead you need to offset into the
record that you want to start writing at.
Secondly, the DmSet() function fills the record with the Byte value of the
last parameter (in your case clickHour & clickMin)

I think what you mean is ..

ULong aHour = clickHour, aMinute = clickMin;

DmWrite(recP, (ULong)&recP->DriverLogRec.PeriodTimestamp.hour - recP,
&aHour, sizeof(ULong));
DmWrite(recP, (ULong)&recP->DriverLogRec.PeriodTimestamp.minute - recP,
&aMinute, sizeof(ULong));

I actually find the following a useful construct too ..

BothRecordsPtr    aNilPtr = NULL;

DmWrite(recP, (ULong)&aNilPtr->DriverLogRec.PeriodTimestamp.hour, &aHour,
sizeof(ULong));

Cheers

---------------------------
Steve Fillingham
CodeDrive Pty Ltd
[EMAIL PROTECTED]



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