Menu

Repeat On

Help
qb_soft
2004-11-03
2013-03-22
  • qb_soft

    qb_soft - 2004-11-03

    Hi
    I followed your examples in the source, but got stuck on the "Repeat On" section. (Datebook Offload). How can I read the Weekly "Repeat on Mon, Tues, Thurs" options from the TpfgPalmRemotetable.

    Thanks in advance

     
    • Paul Gilbert

      Paul Gilbert - 2004-11-12

      Hi there, sorry for not replying sooner. It's been a busy week. The relevant part of the datebook example demonstrates how the repeat details are extracted from a datebook record.  Unfortunately, I'm not an expert on the Datebook; I only briefly looked at it to throw together the example, so if you have any further questions, you'll probably have to refer the original datebook source code in the Palm SDK.

            if afRepeat in Flags then
            begin
              s := 'Repeat: Type = ' + RepeatTypeStrs[RepeatType] + ', End Date = ';
              if t.FieldByName('RepeatEndDate').IsNull then s := s + 'Forever'
              else s := s + DateToStr(t.FieldByName('RepeatEndDate').AsDateTime);
              s := s + ', Frequency = ' + t.FieldByName('RepeatFrequency').AsString;
              if (RepeatType = repeatMonthlyByDay) or (RepeatType = repeatWeekly) then
              begin
                s := s + ', Repeat On = ';
                if t.FieldByName('RepeatOn').AsInteger <> 0 then s := s + 'True'
                else s := s + 'False';
              end;
              if RepeatType = repeatWeekly then
                s := s + ', Start of Week = ' +
                  t.FieldByName('RepeatStartOfWeek').AsString;

              Writeln(f, s);
            end;

       
    • qb_soft

      qb_soft - 2004-11-17

      Hi again
      Thanks for the reply.

      I am trying to write (Post) a record, but am having the greatest of difficulty. It creates the record, but
      the string fields are showing as a square ([]) block.
      I used your PDB Viewer, and the the fields don't seem to line up.

      My code:
          Tbl    := PalmTable;
          Tbl.Open;
          Try
            Tbl.Append;
            Tbl.FieldByName('StartTime'       ).AsString  := '13:00:00';
            Tbl.FieldByName('EndTime'         ).AsString  := '15:00:00';
            Tbl.FieldByName('Date'            ).AsString  := DateToStr(Date);
            Tbl.FieldByName('AlarmAdvance'    ).AsString  := '15';
            Tbl.FieldByName('AlarmAdvanceUnit').AsString  := '0';
            Tbl.FieldByName('Description'     ).AsString  := 'Test';
            Tbl.FieldByName('Note'            ).AsString  := 'Note Test';
            Tbl.FieldByName('Flags'           ).AsInteger := $400 + $1000;  

      Thanks in advance.

       
    • qb_soft

      qb_soft - 2004-11-17

      Oh yes, I do a tbl.post after this...

       
    • qb_soft

      qb_soft - 2004-11-17

      Sorry about all the posts, I managed to get it working properly.

      Just one other question.
      How do I know if a record has been deleted on the palm so that I can update my local app?

      Thanks
      Quentin

       
      • Paul Gilbert

        Paul Gilbert - 2004-11-18

        The Flags property lets you access the flags for each Palm record. There are two of interest: deleted and archived. If a record is physically deleted on the Palm, the deleted flag is set. This is not normally used for tables that may be synchronised, though, since all the data associated with the record is lost.

        The other is Archived, and programs on the Palm regularly use it to simulate a deletion without releasing the raw data of the record. Your synchronisation conduit can therefore detect this flag as it scans through any changed records, and then after properly using the data of the record to perform an appropriate deletion on the local databases, then purge the record from the Palm table.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.