Results 1 to 2 of 2

Thread: How do you Redirect WriteLn and Write in FPC?

  1. #1

    How do you Redirect WriteLn and Write in FPC?

    Is there a cross platform way of doing console method redirects? What I mean is, if I have an library that I'm using that does console writes they will fail within a graphical application. How can I redirect StdOut to, oh say a memo, control on my form?

    I've done a bit of googling, but no avail . I know how to do this in Windows and Delphi, but the solution I use isn't even close to cross platform then.

  2. #2

    How do you Redirect WriteLn and Write in FPC?

    You do it exactly like in Turbo Pascal. Write a procedure assign_xxx, that fills the fields of a textrec. Then close output, assign, and open.

    If you need an example, look at the source code of the crt unit, assignCRT and friends.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •