Textbackground still valid after deleted!! 
Author Message
 Textbackground still valid after deleted!!

Hello,

    I'm fairly new to Pascal and have a little problem.
    When I write for example the following program:

    program example;

           uses crt;

          begin

             Textbackground(3);
             Textcolor(white);

             clrscr;
             writeln('Hello');
             readln;

           end.

    I get the background and text colors ok, but when I take both of those
ENTIRE statements out, the colors still run...what's going on?

    Any help would be appreciated!



Wed, 18 Jun 1902 08:00:00 GMT  
 Textbackground still valid after deleted!!
Hi Evan;

Been there done that. You'll prob. get better answers but here's mine. I
think you'll find even if you exit out of TP to DOS your dos screen will be
in the new colors. That's because you've changed the dos attributes. I'd
change your program as follows:


Quote:
> Hello,

>     I'm fairly new to PASCAL and have a little problem.
>     When I write for example the following program:

>     program example;

>            uses crt;

              VAR
                  DOSATTR : BYTE;
Quote:

>           begin

                 DOSATTR := TEXTATTR;     {STORES DOS ATTRIBUTES};
Quote:
>              Textbackground(3);
>              Textcolor(white);

>              clrscr;
>              writeln('Hello');
>              readln;

               TEXTATTR := DOSATTR;   {RESTORES DOS ATTRIBUTES};
                CLRSCR;    {Rewrites the screen in the original dos colors}
Quote:
>            end.

>     I get the background and text colors ok, but when I take both of those
> ENTIRE statements out, the colors still run...what's going on?

>     Any help would be appreciated!




Wed, 18 Jun 1902 08:00:00 GMT  
 Textbackground still valid after deleted!!
Hi Evan,

Been there done that - You'll prob get better answers but here's mine - I
think you'll find even when you exit to Dos it's screen will be in the new
colors - that's because you've changed the dos attributes. I'd change the
file as follows:

Quote:
> Hello,

>     I'm fairly new to PASCAL and have a little problem.
>     When I write for example the following program:

>     program example;

>            uses crt;

              VAR
                    DOSATTR : BYTE;
Quote:
>           begin

                 DOSATTR := TEXTATTR;   {STORES DOS ENVIRONMENT SETTINGS}
Quote:
>              Textbackground(3);
>              Textcolor(white);

>              clrscr;
>              writeln('Hello');
>              readln;

               TEXTATTR := DOSATTR;   {RESTORES DOS ENVIRONMENT SETTINGS}
                CLRSCR;  {REDRAWS SCREEN USING DOS ENVIRNMENT SETTINGS}
Quote:
>            end.

>     I get the background and text colors ok, but when I take both of those
> ENTIRE statements out, the colors still run...what's going on?

>     Any help would be appreciated!




Wed, 18 Jun 1902 08:00:00 GMT  
 Textbackground still valid after deleted!!

Quote:
> Hello,

>     I'm fairly new to PASCAL and have a little problem.
>     When I write for example the following program:

>     program example;

>            uses crt;

>           begin

>              Textbackground(3);
>              Textcolor(white);

>              clrscr;
>              writeln('Hello');
>              readln;

>            end.

>     I get the background and text colors ok, but when I take both of those
> ENTIRE statements out, the colors still run...what's going on?

>     Any help would be appreciated!

Well, you'll just have to remember that the colour may not always be black
and gray, it only leaves those colours there after they have been on and
haven't changed since, so you may just want to put a
    textbackground(black);
    textcolor(lightgrey);
at the start of your program or at the end of the program, 'cos clrscr
clears the screen with the selected colour, if you want to keep the colour
the same just clear it back you can store the colour in a variable, ie store
in col - col:=textattr; and then reassign it back to normal - textattr:=col;

Ryan Jenkins
  -Silly Stuff 1999



Wed, 18 Jun 1902 08:00:00 GMT  
 Textbackground still valid after deleted!!

Quote:

>Hello,

>    I'm fairly new to PASCAL and have a little problem.
>    When I write for example the following program:

>    program example;

>           uses crt;

>          begin

>             Textbackground(3);
>             Textcolor(white);

>             clrscr;
>             writeln('Hello');
>             readln;

>           end.

>    I get the background and text colors ok, but when I take both of those
>ENTIRE statements out, the colors still run...what's going on?

>    Any help would be appreciated!


I don't whether this is the proper way but you could place the
'Textmode(C80)' at the end of your program which i think resets the screen
back to its original mode. Hope this helps

From
TDR



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. TextBackground

2. TextBackground

3. Textcolor / Textbackground

4. highlighted textbackground in dos-textmode???

5. 'Metafile is not valid'

6. How Do I Check For Valid Type?

7. Find out if a string is valid filename with path

8. "Index not valid"

9. VALID/INVALID INPUT

10. Help to verify valid source

11. TDBImage bitmap image not valid??

12. deleting ok unless the first one to be deleted

 

 
Powered by phpBB® Forum Software