The Example in D5 uses an array of Char instead of String - my guess it will
only work with a pointer to the character array (having not tried it !!!)

Paste from D5 Help:
var

  FromF, ToF: file;
  NumRead, NumWritten: Integer;
  Buf: array[1..2048] of Char;
begin
  if OpenDialog1.Execute then                               { Display Open
dialog box }
  begin
    AssignFile(FromF, OpenDialog1.FileName);
    Reset(FromF, 1);     { Record size = 1 }
    if SaveDialog1.Execute then                              { Display Save
dialog box}
    begin
      AssignFile(ToF, SaveDialog1.FileName);  { Open output file }

      Rewrite(ToF, 1);   { Record size = 1 }
      Canvas.TextOut(10, 10, 'Copying ' + IntToStr(FileSize(FromF))
        + ' bytes...');
      repeat
        BlockRead(FromF, Buf, SizeOf(Buf), NumRead);
        BlockWrite(ToF, Buf, NumRead, NumWritten);
      until (NumRead = 0) or (NumWritten <> NumRead);
        CloseFile(FromF);
        CloseFile(ToF);
    end;
  end;
end;

Regards
Paul McKenzie

=========================
Paul McKenzie
Jetbet II Developer
=========================
[EMAIL PROTECTED]
Ph: (04) 576-6822

T.A.B. National Office
106-110 Jackson Street
Petone
New Zealand



____________________Reply Separator____________________
Subject:  RE: [DUG]:  Blockwrite strings
Author:   [EMAIL PROTECTED]
Date:          25/06/2001 14:14



     > Try using StringVar[1] or PChar(StringVar)?
     I was wondering if Blockwrite needed a null terminated string pointer.  It
     doesn't say so on the help but I will try it tonight when I get home from
     work.  I don't have a manual because I'm using the free Standard version
     that came with the June "PC World" magazine.

     Cheers,
     Ross.
     ---------------------------------------------------------------------------
         New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                       Website: http://www.delphi.org.nz
     To UnSub, send email to: [EMAIL PROTECTED]
     with body of "unsubscribe delphi"(See attached file: att1.eml)

att1.eml

Reply via email to