Board index » delphi » Compare TTable Record to Other Structure

Compare TTable Record to Other Structure

Hello All:

        I am reading information into my app from a fixed length ASCII file. My
app is Delphi 3 on Paradox 7 tables. Due to file sharing issues ( the
ASCII file is a networked accounting inventory file ) Batchmove cannot
be used.

        Fileopen and FileRead work great. I'm reading the ASCII file record
into a record structure.

        If the ASCII file record is different than my record, I need to
update/edit my record. Otherwise, I can simply move to the next record (
Every day the new inventory is uploaded and changes to costs and options
are refreshed ).

        How can I detect if the TTable record is identical to the ASCII record
structure in which the record was read into ???

        Currently I am updating every record even when no changes have
occurred.

        Thank you.

Neil Huhta

 

Re:Compare TTable Record to Other Structure


Quote
>>        How can I detect if the TTable record is identical to the ASCII record
>>structure in which the record was read into ???

Assuming the structures of the Px / Ascii tables are the same:

for i := 0 to myPxTable.fieldCount-1 do
  if myPxTable.fields[i].value <> myAsciiTable.fields[i].value then
  // record changed.... do something

=Bill=

Other Threads