Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-05

System unit / val-procedure

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth
to Engelbert Buxbaum
Engelbert Buxbaum wrote
> Bart 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. :)

Show quoted text 11 lines
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

Reply by email

Michael Fuchs
to Engelbert Buxbaum: An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/laz…
Engelbert Buxbaum wrote
> Bart wrote: > Please provide code example.

Add a "begin" after the "then" in line 58 and the error is gone (don't forget to remove "System" from the uses part).

Then you can fix the other bugs in your code.
"ReadChar := value;" in Line 82 is the next one.

And by the way: the way you format your source code is not the best.

hth
Michael

Reply by email