Redirection and Screen I/O

new topic     » topic index » view thread      » older message » newer message

I have been trying to write a program that outputs directly to the
screen EVEN IF the user who invokes it happens to redirect output.

I noticed that the ed.ex program just uses standard out for all of
it's screen writes, so I thought I would modify it a little, and
instead of setting SCREEN = 1, I would set SCREEN = open("CON","w")
but if I do this, the screen is definitely messed up.

BTW -- if you type the following command 'ex ed.ex >test' with the
unhacked version of ed.ex it doesn't work right either...

So what is the problem ? Is there a way to do text-based screen I/O
without assuming that stdout is pointing there ?

(I have been trying to modify a Turbo-Pascal program I wrote a while
back that had to deal with the same issue -- not using stdout for
screen writes. In TP, though, opening the console worked correctly )

Any ideas ? Or is this possible a bug/feature of the interpreter
itself ?

-tim

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu