www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/06/23:38:04

To: djgpp AT delorie DOT com
Date: Fri, 6 Dec 1996 23:20:17 PST
Subject: Newbie Question: Why doesn't this work?
Message-ID: <19961206.232059.4631.0.Praxis_Beta@juno.com>
From: praxis_beta AT juno DOT com (Bruce A Locke)

Hello everyone.

Below is a little runt of a program that I have been fidiling with in
order to learn the <conio.h> fuctions.  But I cannot figure out why it
doesn't work the way I want it to.

The ClrScr() command seems to do nothing at all in the program despite
INFO help stating that it clears the screen.  Also, even if I set the
textcolor() and textbackground(), The existing screen attributes take
priority over the colors I set.....

Does DJGPP handle CONIO differently than in other dos compilers, or am I
in error?

Thanks in advance.....



-- Start of source --

#include <conio.h>

void main(void)

{

        int xcount;
        int ycount;
        char *background_character;
        background_character = "_"; // char 176

         for (xcount=1;xcount<81;xcount++)
                for (ycount=1; ycount<26; ycount++)
                    {

                        textcolor(6);
                        textbackground(0);
                        //cprintf("%i,%i\n\r",xcount,ycount);
                        gotoxy(xcount,ycount);
                        putchar(*background_character);
                    };

        textcolor(15);
        textbackground(0);
        clrscr;

        window (10,5,70,20);

        textcolor(15);
        textbackground(4);
        clrscr();  
        cprintf(" ERROR!!!!! ILLEGAL REGISTRATION CODE!!!! \n\r");
        getkey();
}

-- End of Source --


===================================================

Bruce Locke
Praxis_Beta AT Juno DOT Com

- Raw text -


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