Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change background color and text color

Posted on 1999-06-24
17
Medium Priority
?
222 Views
Last Modified: 2010-04-02
I am trying to create a simple splash screen program.  Our instructor showed that we'd use the "textbackground" and
"textcolor" functions.  I am using Borland C++ 4.52.

Supposedly all I have to put in my program is:

textbackground(BLUE);
textcolor(YELLOW);

but I come up with errors - "undefined function".

Anybody have any thoughts on how to fix this?

Thanks.
0
Comment
Question by:regent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
17 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1198406
#include <conio.h>
or
#include <dos.h>
0
 

Author Comment

by:regent
ID: 1198407
I did.  Here's my code:


#include <iostream.h>
#include <conio.h>

void main()
{
      textbackground(BLUE);
              textcolor(YELLOW);
      clrscr();
      cout << endl << endl << endl << endl;
      cout << "         ************************************************************";
      cout << endl << endl << endl;
      cout << "                                 THOMAS REGEN" << endl;
      cout << "                                   CPT  123";
      cout << endl << endl;
      cout << "                        PROGRAM NAME:    SPLASH SCREEN";
      cout << endl << endl << endl;
      cout << "         ************************************************************";
      cout << endl << endl << endl;
      cout << "         PRESS ANY KEY TO CONTINUE...";
      getch();
}
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 1198408
Be sure to include <conio.h>
It is the header file that contains the prototype for the background and foreground text colors
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:regent
ID: 1198409
I did include <conio.h>.  See code above.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1198410
Try

#include <conio.h>
#include <iostream.h>
0
 

Author Comment

by:regent
ID: 1198411
I didn't see a new comment.  

<conio.h> was included.  See code above.
0
 

Author Comment

by:regent
ID: 1198412
Nope, that didn't work either.
0
 

Author Comment

by:regent
ID: 1198413
Can anyone compile and run my code to see if you can get it to work?
0
 
LVL 23

Expert Comment

by:chensu
ID: 1198414
What about #include <dos.h>?
0
 

Author Comment

by:regent
ID: 1198415
No, that didn't work either.  This is really frustrating because you know it's gotta be something simple.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1198416
Open conio.h and search for textbackground. Is there any #if before it?
0
 

Author Comment

by:regent
ID: 1198417
Not that I can tell.
0
 
LVL 6

Expert Comment

by:WxW
ID: 1198418
It is DOS ?
0
 

Author Comment

by:regent
ID: 1198419
Not that I can tell.
0
 

Author Comment

by:regent
ID: 1198420
<dos.h> didn't work either.  Has anyone been able to compile and run my code?  I'm about to give up.
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 400 total points
ID: 1198421
Reason for this: those 2 functions can use only in
Dos/Windows 32:
For use it you can:
1. Use BC 3 for Dos.
2. Use BC 5 for Windows , but make Console Application!
I hope, it helps.
Alex
0
 

Author Comment

by:regent
ID: 1198422
Thanks Alex!  You were right, 4.52 (for some reason), doesn't recognize those funictions (even though the Help discusses them).  Once I got to school and compiled it on 5.02, it worked like a champ.  Thanks again.  Thomas
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question