[Lazarus] System unit / val-procedure

Sven Barth pascaldragon at googlemail.com
Wed May 30 14:57:40 CEST 2012


Am 30.05.2012 14:43, schrieb Engelbert Buxbaum:
>  > Bart <bartjunk64 at gmail.com> wrote:
>  > Please provide code example.

> uses Classes, System;

1. You must not use unit "System" yourself. It's always included 
automatically by the compiler. So remove "System" and things go well. :)

>        while (hilfs <> TAB) do
>           begin
>             if (hilfs = '-')
>               then
>                 ReadByte := 255;                                               { used as 'data not available' marker }
>                 exit;
>               end;
>             hst := hst + hilfs;
>             read(DataFile, hilfs);
>           end;
>       Val(hilfs, value, error);

Here happened your other error. I quote:

buxbaum_mail.pas(66,7) Fatal: Syntax error, "BEGIN" expected but 
"identifier VAL" found

You need to read the error correctly. It has something to do about 
"begin"-"end" and not "val". So if you look above your "ReadByte := 
255;" you'll notice that there is a "begin" missing after the "then".

Regards,
Sven




More information about the Lazarus mailing list