program yourprogram;<br><br>{$mode objfpc}{$H+}<br><br>uses<br> Classes, SysUtils;<br>var<br> st: text;<br> s: string;<br>begin<br> assign(st,'');<br> reset(st);<br> while not eof(st) do begin // <<<<<<<<--- iterate while not en of file
<br> readln(st,s); //<<< read only a line<br> writeln(s);<br> end;<br> close(st); // <<<<<--- <br>end.<br><font color="#888888"><br></font><br>-- <br>Att,<br><br>Wanderlan Santos dos Anjos<br>
<br><div class="gmail_quote">On Nov 24, 2007 8:15 AM, TOUZEAU DAVID <<a href="mailto:david.touzeau@fr.kaspersky.com">david.touzeau@fr.kaspersky.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear<br><br>What is the best way to read into a memory datas from this command.<br><br><br>"/bin/myprogram </home/tests/file.txt "<br><br><br>my test program read only the first line from stdline.<br>What i miss ???
<br><br><br>program myprogram;<br><br>{$mode objfpc}{$H+}<br><br>uses<br> Classes, SysUtils;<br>var<br> st: text;<br> s: string;<br>begin<br> assign(st,'');<br> reset(st);<br> readln(st,s);<br><br> writeln(s)
<br><br>end.<br><font color="#888888"><br><br><br>--<br>David Touzeau -------------------------- Linux Ubuntu 7.04 feisty<br>FreePascal-Lazarus,perl,delphi,php artica for postfix management console<br>(<a href="http://www.artica.fr" target="_blank">
http://www.artica.fr</a>) icq:160018849<br>_______________________________________________<br>fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">
http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></font></blockquote></div><br><br clear="all"><br>