typed and untyped files un Delphi 8 and Delphi 2005

From: Carlos Sanchez (carlos_at_no.com)
Date: 01/27/05

  • Next message: Maarten Wiltink: "Re: Elementary Qs on objects"
    Date: Thu, 27 Jan 2005 12:23:02 GMT
    
    

    It seems that 'file' type are not supported anymore in the new .net
    compilers, but I have to load binary file contents into memory.

    I have

    type myrecord = record
    ....
    .....
    end;

    type myarray = array of myrecord;

    And I have to load this array from a binary file.

    I've tried filestream but also parameters for read and readbuffer has
    changed: now the first parameter is not 'var buffer' (untyped), but the
    method has been overloaded and there is a lot of 'Read' methods for a lot of
    types (var buffer: integer, var Buffer: char, etc.), but of course there is
    not a 'var buffer: myrecord'.

    I've even tried to use casting:

    F.Read(byte(MyRecordVar), SizeOf(MyRecord));

    but I obtain 'invalid type cast'.

    I've been looking onto bdn, google, and I only find the same question from
    other people, but no answer :(

    Well, do I have to switch back to Turbo Pascal? ;)


  • Next message: Maarten Wiltink: "Re: Elementary Qs on objects"