instead of chop: record declare in the Var section of the function, put
chop : TChopParam;
Jeremy
-----Original Message-----
From: Alistair George <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Mon, 21 Oct 2002 17:13:40 +1300
Subject: [DUG]: Whats going on here?
> Hi all.
>
> The following:
> TChopParam = Record
> Filename : String;
> Container : String;
>
> Size : Integer;
> { Options }
> SavePath : Boolean;
> End;
>
> To use I did the following:
>
>
> function TAddForm.FileSizeOK(FileName: string): boolean;
> var
> f: file of Byte;
> s: longint;
> chop: Record
> Filename : String;
> Container : String;
>
> Size : Integer;
> { Options }
> SavePath : Boolean;
> End;
> begin
> result := true;
> AssignFile(f, FileName);
> Reset(f);
> s := filesize(f);
> if (s > 2000000000) or (s < 0) then
> begin
> MessageDlg('File:' + FileName + ' is too large.' , mtWarning,
> [mbOK], 0);
> result := false;
>
> //FROM HERE
> chop.Filename:=filename;
> chop.Size:=1000000000; // 1 Gig max size
> chop.Container:='chopper.spt';
> filechopper1.Chop(chop);
> //TO HERE
> end;
> CloseFile(f);
> end;
>
> And because I am code rusty, I am getting an 'incompatible type,
> tchopparam and
> record'
> How to assign the values correctly?????
> Tks,
> Al+
>
> -----------------------------------------------------------------------
> ----
> 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"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
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"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/