TextFile to Real

makovechmakovech Czech republic

Hi.
I need to convert my file of text ... looks like 183,50'enter'156,25'enter' and so on ... convert to file of reals because I have to do some counting with those numbers.
This is my code

var invest: text; slovo: string; inv: file of real;
begin
assign(f, 'inv.txt');
reset(f);
rewrite(inv);
while not EOF(f) do
begin
readln(f, slovo);
procedure Val(const slovo:string; var U: real; var Code: Word);
writeln(inv, U);
end;
end.

but it writes me error ... illegal extension.
So any help would be really great.
Thanks :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories