Mail Archives: djgpp/1998/01/25/20:16:23
Qbasic writes directly to video memory, I believe. printf() uses stdout, which I assume uses the low-level DOS call to send a string of characters to the console. I don't know of a solution using the std C functions, but maybe allegro's textout() might help. You might also try writing a function that uses a BIOS interrupt and redirecting that... but I don't think redirection picks it up at the DOS level.
In message <34CC25D9 DOT 61F6 AT swipnet DOT se>, Ragnar Kellari <kellari AT swipnet DOT se> wrote:
> In compiled Qbasic the output of a program can be redirected to a file
> (with the ">"-sign) even if I use colored text. The colors are
> automaticaly filtered off the text.
> This is the problem:
> When I use printf the output goes to stdout and may then be redirected to
> a file but the only way I can use colors with printf is by sending
> escape-sequences to ansi.sys. Then when the output is redirected to a
> file the escape-sequence goes there aswell.
> With cprintf, redirection is not possible as the output goes directly to
> the screen.
> Does anyone have a smart solution to this problem?
> (I wonder how the COLOR-statement in Qbasic works?)
>
>
- Raw text -