[Lazarus] more file operation problems

Henry Vermaak henry.vermaak at gmail.com
Mon Dec 12 18:17:41 CET 2011


On 12/12/11 17:09, Chris Kelling wrote:
> I'm trying to assign the number of records to the rowCount of a
> stringgrid control. See the following code fragment:
>
> var
> stock : stockitem;
> rowNum : integer;
> {inventory is defined as a file of stockitem in another unit}
>
> begin
> assignfile(inventory,'Ops');
> reset(inventory);
> stgInvOps.RowCount:= filesize(inventory);
>
> When I compile the program, I get:
>
> dashboard.pas(115,42) Error: Incompatible type for arg no. 1: Got "File
> Of StockItem", expected "AnsiString" with 'inventory' highlighted
> on the line "stgInvOps.RowCount:= filesize(inventory);"
>
> What am I doing wrong?

It's using the wrong function, try System.FileSize?

Henry




More information about the Lazarus mailing list