title: Delphi 7 and Delphi 2010 to Delphi Xe6 Read File Conflict
body: <p>I got this source code but some how I'm confused about the lines why in Delphi 7 the size of the integer is 33 BUT in using Delphi XE6 the size is 65.</p>
  
  <p>I just want to get the same integer value from Delphi XE6 Result is 65 to my Delphi 7 result value is 65 also.</p>
  
  <p>This are the codes.</p>
  
  <pre><code>unit Unit1;
  interface
  uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
  type
  TForm1 = class(TForm)
      Button1: TButton;
      procedure Button1Click(Sender: TObject);
  private
      { Private declarations }
  public
      { Public declarations }
  end;
  
  var
  Form1: TForm1;
  implementation
  {$R *.dfm}
  
  //IS THE PROBLEM IN THIS FUNCTION?
  function HeadBufBytes(InFileName: String) : string;
      Inf : TFileStream;
      Buf : array[0..5] of char;
  begin
  //codes here....
      Inf.ReadBuffer(Buf, SizeOf(Buf));
  //codes here...
  end;
  
  //EDITED CODES FOR SIMPLE LOOK
  
  procedure ReadDataFile(strFilename : string; strDestDir : string);
  var
  firstF:file;
  posRead,nRead:Integer;
  Buf : array[1..2048] of Char;
  strHeadByte:string;
  begin
  strHeadByte:=HeadBufBytes(strFileName);
  AssignFile(firstF, strFileName);
  Reset(firstF, 1);
  BlockRead(firstF, Buf, SizeOf(Buf), nRead);
  posRead:=Pos(strHeadByte, Buf);
      //PROBLEM LINE
      //WHAT IS THE PROBLEM IN THIS CODE
      showmessage(inttostr(posRead));
      //IN DELPHI7 THE RESULT IS 33
      //IN DELPHI 2010 TO XE6 THE RESULT IS 65
      //WHAT IS THE PROBLEM IN THIS CODE
      //PROBLEM LINE
  CloseFile(firstF);
  end;
  
  procedure TForm1.Button1Click(Sender: TObject);
  begin
  ReadDataFile('00001.dat', extractfilepath(application.ExeName));
  end;
  
  end.
  </code></pre>