RE: Error reading Binary files using Delphi2006

2010-08-23 Thread John Dammeyer
Of wvido...@metsec.com > Sent: Monday, August 23, 2010 12:41 AM > To: delphi@elists.org > Subject: RE: Error reading Binary files using Delphi2006 > > > > Yes, the record is not defined as PACKED but in the compiler > option for > D5 the Align Record Fields option is c

RE: Error reading Binary files using Delphi2006

2010-08-23 Thread wvidogah
. -Original Message- From: delphi-boun...@elists.org [mailto:delphi-boun...@elists.org] On Behalf Of wvido...@metsec.com Sent: 23 August 2010 08:41 To: delphi@elists.org Subject: RE: Error reading Binary files using Delphi2006 Yes, the record is not defined as PACKED but in the compiler option for D5

RE: Error reading Binary files using Delphi2006

2010-08-23 Thread wvidogah
-boun...@elists.org [mailto:delphi-boun...@elists.org] On Behalf Of Richard Saunders Sent: 21 August 2010 13:58 To: delphi@elists.org Subject: Re: Error reading Binary files using Delphi2006 On 8/20/2010 11:32 AM, wvido...@metsec.com wrote: > I wrote an application using delphi5 which reads

Re: Error reading Binary files using Delphi2006

2010-08-22 Thread Barton Bresnik
William, Though I don't have the specific answer, note that newer versions of Delphi use multi-byte Strings by default. Is there an option as project default to use ANSI strings, or else set the local String variable types to AnsiString.That might solve your problem. Bart From: Subject: Error

Re: Error reading Binary files using Delphi2006

2010-08-22 Thread Sid Gudes
Haven't used D 2006, so don't know all the gotchas, but perhaps the "packed" or "$Align" defaults are different, so record definition is packed in one version of Delphi but aligned in the other? At 09:32 AM 8/20/2010, wvido...@metsec.com wrote: Dear All, I wrote an application using delphi5 w

Re: Error reading Binary files using Delphi2006

2010-08-22 Thread Richard Saunders
On 8/20/2010 11:32 AM, wvido...@metsec.com wrote: I wrote an application using delphi5 which reads and writes binary file using TFilestream. But then when I ported the application to Delphi 2006 the files written using old application returns junk data in the new version. The record that is

Re: Error reading Binary files using Delphi2006

2010-08-22 Thread Gunnar Blumert
William, obviously the record is *not* the same, otherwises it would work. You should check the alignment of the fields in the record. For records to be written to disk it is always a good idea to declare them as PACKED RECORD to avoid problems like yours. Good luck, Gunnar - Original Me