<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 20 March 2015 at 20:54, Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 20.03.2015 21:18, vfclists . wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
<br>
<br>
On 20 March 2015 at 19:34, Sven Barth <<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a><br></span><span class="">
<mailto:<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@<u></u>googlemail.com</a>>> wrote:<br>
<br>
    Am 20.03.2015 19:19 schrieb "vfclists ." <<a href="mailto:vfclists@gmail.com" target="_blank">vfclists@gmail.com</a><br></span>
    <mailto:<a href="mailto:vfclists@gmail.com" target="_blank">vfclists@gmail.com</a>>>:<span class=""></span><br><div><div class="h5"></div></div></blockquote></blockquote><div><br></div><div>snip  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
How do you ensure own implementation overrides the system's<br>
implementation, does the compiler take care of that automatically, or<br>
will you have to name your function differently?<br>
</div></div></blockquote>
<br>
There is no need to ensure that. Here is an example:<br>
<br>
=== code begin ===<br>
<br>
var<br>
  f, oldout: TextFile;<br>
begin<br>
  Writeln('Hello Output as StdOut');<br>
<br>
  oldout := Output;<br>
<br>
  Assign(Output, 'test.txt');<br>
  Rewrite(Output);<br>
<br>
  Writeln('Hello Output as file');<br>
<br>
  Close(f);<br>
<br>
  Output := oldout;<br>
<br>
  Writeln('Hello Output as StdOut again');<br>
end.<br>
<br>
=== code end ===<br>
<br>
To see how such a TextFile is implemented you can take a look at unit StreamIO which is part of FPC's units.<br>
<br>
(Though I wonder why "Assign(f, 'test.txt'); Output := f; Writeln('Hello Output as file');" does not work :/ )<br>
<br>
Regards,<br>
Sven<div class=""><div class="h5"><br>
______________________________<u></u>_________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.<u></u>org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/<u></u>cgi-bin/mailman/listinfo/fpc-<u></u>pascal</a><br>
</div></div></blockquote></div><br></div><div class="gmail_extra">I need to get the output of a program which uses a lot of Write and Writeln commands into the GUI in realtime, by that I not having to output it to a text file and reading it afterwards, but by capturing the output of each Write command into a variable and displaying it in the GUI immediately.<br><br></div><div class="gmail_extra">If each Write or Writeln could trigger an event, I could use the event to capture the output. My other option is to replace the calls to write with my own function, but Write has different number of call parameters and it may require as many variants of the function as are used in the program, assuming that the call syntax is regular, not something like this one - write(JSValToDouble(cx,pom^)):1:scale).<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a></div>
</div></div>