delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/22/18:45:41

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help with text* ?
Date: Wed, 22 Apr 1998 18:39:40 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 31
Message-ID: <353E71AC.364@cs.com>
References: <6hkk9f$b7p$1 AT news DOT metronet DOT de>
NNTP-Posting-Host: ppp215.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Lennart Marien wrote:
> 
> Hi!
> Maybe this is a general question which is answered yet,
> but why doesn´t  textcolor or textbackground work in
> DJGPP.I´m using the C compiler.It neither works
> in graphic mode nor in textmode.I know the BIOS
> Function to set Textattributes, should I use them instead?

Let me guess - you're using textcolor(), etc. with printf()?  This is
wrong, because printf() goes through the DOS file handling functions and
never sees your color settings.  You should use conio.h functions for
output when you change the text attributes.

> And another simple
> question how can I
> set the RAND_MAX value, described in the help?

You can't set it; it's a constant.  To clip the value from rand() or
random(), use the modulus operator:

  /* get value from 0 to 99 */
  x = random() % 100;

-- 
---------------------------------------------------------------------
|      John M. Aldrich       |"Men rarely (if ever) manage to dream |
|       aka Fighteer I       |up a god superior to themselves. Most |
|   mailto:fighteer AT cs DOT com   |gods have the manners and morals of a |
| http://www.cs.com/fighteer |spoiled child."    - Lazarus Long     |
---------------------------------------------------------------------

- Raw text -


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