delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/25/20:16:23

Date: Sun, 25 Jan 1998 20:15:27 -0500 (EST)
Message-Id: <199801260115.UAA01545@p2.acadia.net>
To: Ragnar Kellari <kellari AT swipnet DOT se>
Subject: Re: Redirecting cprintf
Cc: djgpp AT delorie DOT com
References: <34CC25D9 DOT 61F6 AT swipnet DOT se>
in-reply-to: <34CC25D9.61F6@swipnet.se>
From: swarnerx3 AT acadia DOT net (Scott Warner)
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019