Thanks to Rob and Jangita for their answers on my previous question.
It is obvious in hindsight. 
Now that I have the EOF issue solved, I find a new problem. It seems
that TFileStream.read does not work with dynamic arrays.

This code does not work. b_read is always zero, and nothing is read
from the stream:

   var   
     pbProg : array of byte;
     cbProgram      : longword;  
 <...snip...>
    Setlength(pbProg, bkhdr.cbProgram);
    b_read := sS.read( pbProg, bkhdr.cbProgram );

This code works normally. The requested number (if less than 8192) of
bytes are read:

   var   
     pbProg : array [0..8191] of byte;
     cbProgram      : longword;  
 <...snip...>
    b_read := sS.read( pbProg, bkhdr.cbProgram );


What am I missing or doing wrong? Is this a known limitation of
TFileStream? 

Thanks,

Tim.






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to