TextFile to Real - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

TextFile to Real

makovechmakovech Czech republicPosts: 1Member

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.