Converting formatted memo fields

Hello all,

I'm having great difficulties in converting Paradox formatted memo
fields to memo fields via the DbiDoRestructure call.  Here is the code
where I set up the field descriptor:

    //Modify the Field descriptors
    iOffsetDiff := 0;
    for i := 1 to Cursor.iFields do
    begin
         bModified := False;

         //Adjust the field offset
         if iOffsetDiff <> 0 then
         begin
              pCurrentfield.iOffset := pCurrentField.iOffset +
iOffsetDiff;
              bModified := True;
         end;

         //Change Fmt -> Memo
         if (pCurrentField.iFldType = fldBLOB) and
            (pCurrentField.iSubType = fldstFMTMEMO) then
         begin
              pCurrentField.iSubType := fldstMEMO;
              pCurrentField.iLen := pCurrentField.iLen + 1;
              Inc(iOffsetDiff);
              bModified := True;
         end;

         //Set field nums
         if pCurrentField.ifldNum <> i then
         begin
              pCurrentField.ifldNum := i;
              bModified := True;
         end;

         //Set Op Type
         if bModified then
            pOpType^ := crMODIFY
         else
             pOpType^ := crNOOP;

         Inc(pCurrentField);
         Inc(pOpType);
    end;
    //Reset these pointers!!
    Dec(pCurrentField, i - 1);
    Dec(pOpType, i - 1);

Can anyone provide any assistance? Thanks in advance!

Brett Hopkins
Catapult Systems Corp.