RTC Forums
April 18, 2024, 04:41:56 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Small correction to "Copy TDataSet into rtc_DataSet"  (Read 3893 times)
Walter
RTC License++
*****
Posts: 16


« on: November 25, 2009, 11:14:12 PM »

Just a couple of unnecessary lines.  (A bit of Cut and Paste leftovers!)
Two nice functions!  Thanks.

See two lines commented out.


How to copy data from a TDataSet into a rtc_DataSet object?
<..snip..>
 if ClearFieldDefs then
  begin
    rtcDS.Clear;
    for flds := 0 to DelphiDS.FieldCount - 1 do
    begin
      fdef := DelphiDS.FieldDefs.Items[flds];
      fldname := fdef.Name;

     // field := DelphiDS.FindField(fldname);    <<<<<<<<<<<<<
     // if assigned(field) then                       <<<<<<<<<<<<<
     
     rtcDS.SetField(fldname,
       RTC_DB2FIELD_TYPE[fdef.DataType],
       fdef.Size,
       fdef.Required);
    end;
  end;

<..snip..>

Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: November 26, 2009, 12:08:58 AM »

Thank you for your feedback.

I've updated the article now (removed the 2 unnecessary lines).

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.