title: Delphi read file at specific address
body: <p>This question is very basic because I am at a very basic level. I have to read the contents of a file with a <code>*.pam</code> extension. It's not common, that's a file generated by a specific program and it has a fixed size of xx KB. There are some numbers and values inside it.</p>
  
  <p>I need to read this file and so I am going to use <code>TStreamReader</code>. Of course I need to know the structure of the file but I don't. By the way I have the picture above that is a part of a table with useful info:</p>
  
  <p><a href="https://i.stack.imgur.com/6S0R5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6S0R5.png" alt="enter image description here"></a></p>
  
  <p>The meaning is the following: once you've opened the file, go to a specific address and get the data. For example, in 0x30 I can find the data about 'Move 1 Current PP'. My question is: how do I jump to a given address?</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var sw: TStreamReader;
  begin
  
   Memo1.Clear;    
   sw := TStreamReader.Create('C:\aaa\myfile.pam', TEncoding.UTF8);
   try
  
    sw.Position := 0;
  
   finally
    sw.Free;
   end;
  </code></pre>
  
  <p>I have seen in the documentation that there is something like <code>Seek</code> and <code>Position</code> but it seems that I cannot use them. In general I would use</p>
  
  <pre><code>while not(sw.EndOfStream) do
   begin
    //read...
   end;
  </code></pre>
  
  <p>This starts from the beginning and it reads the data in seqence. How can I jump to a specific address and read the content? I guess that I can pass the hex address to a function like Seek, so I can go to a specific point. Then I can just retrieve the data.</p>