Sign in Join

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

Mailing lists / fpc-pascal / 2005-04

Pascal data flows

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

poof65

Hello mailing user.
I'm a poor french guy who had a little problem ;-) I've read in a book that it was possible to redirect data flows to files.

After doing my research on google, i've found a webpage talking about it. http://www.ictp.trieste.it/~manuals/programming/sun/pascal/lang_ref/ref_io.doc.html#327

I've tried to make a little program with theses examples.

program test (output);
begin
        rewrite(output, 'test.txt');
end.

During compilation with FPC v1.9.8 (under windows xp sp1), errors occurs.

testing.pas(3,35) Error: Incompatible type for arg no. 2: Got "ShortString", expected "LongInt"
testing.pas(4,4) Fatal: There were 1 errors compiling module, stopping
Error: Error during compilation

In your opinion, what's the problem ? have i forgotten to include a unit file ? Thank you for reading all my problem.

PS: i'm sorry for my bad english and all mistakes in my text.

Reply by email

Michael Van Canneyt
to poof65
poof65 wrote 13 lines
Hello mailing user. I'm a poor french guy who had a little problem ;-) I've read in a book that it was possible to redirect data flows to files. After doing my research on google, i've found a webpage talking about it. http://www.ictp.trieste.it/~manuals/programming/sun/pascal/lang_ref/ref_io.doc.html#327 I've tried to make a little program with theses examples. program test (output); begin rewrite(output, 'test.txt'); end.

That will not work. You'll need to do something like

 program test (output);
 begin
   Close(output);
   Assign(output, 'test.txt');
   Rewrite(output);
   Writeln('This should go to test.txt');
   Close(output); // don't forget this.
 end.

Here it works.

Michael.

Reply by email

poof65

Wonderful, it works fine.
Thank you for your answer Michael.

Show quoted text 38 lines
On Tue, 12 Apr 2005, poof65 wrote: > Hello mailing user. > I'm a poor french guy who had a little problem ;-) > I've read in a book that it was possible to redirect data flows to files. > > After doing my research on google, i've found a webpage talking about it. > http://www.ictp.trieste.it/~manuals/programming/sun/pascal/lang_ref/ref_io.doc.html#327 > > I've tried to make a little program with theses examples. > > program test (output); > begin > rewrite(output, 'test.txt'); > end. That will not work. You'll need to do something like program test (output); begin Close(output); Assign(output, 'test.txt'); Rewrite(output); Writeln('This should go to test.txt'); Close(output); // don't forget this. end. Here it works. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email