text color

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ivan

    #1

    text color

    Hi all,

    what is the name of the function to change the text color when programming
    in C under msdos?

    thanks
    ivan


  • Robert Riebisch

    #2
    Re: text color

    ivan schrieb:
    what is the name of the function to change the text color when programming
    in C under msdos?
    That's depends on your compiler (RTL).

    --
    Robert Riebisch
    Bitte NUR in der Newsgroup antworten!
    Please reply to the Newsgroup ONLY!

    Comment

    • ivan

      #3
      Re: text color


      "Robert Riebisch" <Robert.Riebisc h@arcor.deha scritto nel messaggio
      news:45114428$0 $18487$9b4e6d93 @newsspool3.arc or-online.net...
      ivan schrieb:
      >
      what is the name of the function to change the text color when
      programming
      in C under msdos?
      >
      That's depends on your compiler (RTL).
      >
      VC++ Express..
      --
      Robert Riebisch
      Bitte NUR in der Newsgroup antworten!
      Please reply to the Newsgroup ONLY!

      Comment

      • Robert Riebisch

        #4
        Re: text color

        ivan schrieb:
        VC++ Express..
        You can't do DOS in Visual C++ Express!

        You are probably talking about a command line window. That's not DOS!
        You are off-topic here.

        --
        Robert Riebisch
        Bitte NUR in der Newsgroup antworten!
        Please reply to the Newsgroup ONLY!

        Comment

        • osmium

          #5
          Re: text color

          "ivan" writes:
          "Robert Riebisch" <Robert.Riebisc h@arcor.deha scritto nel messaggio
          news:45114428$0 $18487$9b4e6d93 @newsspool3.arc or-online.net...
          >ivan schrieb:
          >>
          what is the name of the function to change the text color when
          programming
          in C under msdos?
          >>
          >That's depends on your compiler (RTL).
          >>
          >
          VC++ Express..
          Then post your question to a newsgroup that discusses that compiler. Read
          the FAQ for this newsgroup.


          Comment

          • Herbert Kleebauer

            #6
            Re: text color

            ivan wrote:
            "Robert Riebisch" <Robert.Riebisc h@arcor.deha scritto nel messaggio
            what is the name of the function to change the text color when programming
            in C under msdos?
            That's depends on your compiler (RTL).
            >
            VC++ Express..
            http://msdn.microsoft.com/library/de...tattribute.asp

            Comment

            • Richard Heathfield

              #7
              Re: text color

              Robert Riebisch said:
              ivan schrieb:
              >
              >VC++ Express..
              >
              You can't do DOS in Visual C++ Express!
              Yes, you can. You can use Visual C++ Express to write a DOS clone, no
              problem.

              What you can't do is Visual C++ Express in DOS. And Visual C++ Express does
              not allow you to target DOS directly. (Obviously, you could use it to write
              a *program* that generates a 16-bit executable! But Visual C++ won't do it
              itself.)
              You are probably talking about a command line window.
              Ah, now you have me. Yes, probably he is...
              That's not DOS!
              ....and probably it isn't. (It might be - he could be running a DOS
              emulator...)
              You are off-topic here.
              ....and here!

              --
              Richard Heathfield
              "Usenet is a strange place" - dmr 29/7/1999

              email: rjh at above domain (but drop the www, obviously)

              Comment

              • Mark McIntyre

                #8
                Re: text color

                On Wed, 20 Sep 2006 15:02:41 +0200, in comp.lang.c , "ivan"
                <wolfsafety@wol fsafety.itwrote :
                >Hi all,
                >
                >what is the name of the function to change the text color when programming
                >in C under msdos?
                This is a FAQ.

                --
                Mark McIntyre

                "Debugging is twice as hard as writing the code in the first place.
                Therefore, if you write the code as cleverly as possible, you are,
                by definition, not smart enough to debug it."
                --Brian Kernighan

                Comment

                • kondal

                  #9
                  Re: text color


                  ivan wrote:
                  Hi all,
                  >
                  what is the name of the function to change the text color when programming
                  in C under msdos?
                  >
                  thanks
                  ivan
                  You can use ANSI escape sequence codes



                  -kondal

                  Comment

                  • Keith Thompson

                    #10
                    Re: text color

                    "kondal" <kondal04@gmail .comwrites:
                    ivan wrote:
                    >what is the name of the function to change the text color when programming
                    >in C under msdos?
                    >
                    You can use ANSI escape sequence codes
                    >
                    http://en.wikipedia.org/wiki/ANSI_escape_code
                    Only if you're using an ANSI-compatible terminal or emulator.

                    --
                    Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
                    San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
                    We must do something. This is something. Therefore, we must do this.

                    Comment

                    • ivan

                      #11
                      Re: text color

                      ok thanks everyone...


                      "Keith Thompson" <kst-u@mib.orgha scritto nel messaggio
                      news:lnpsdo3klg .fsf@nuthaus.mi b.org...
                      "kondal" <kondal04@gmail .comwrites:
                      ivan wrote:
                      what is the name of the function to change the text color when
                      programming
                      in C under msdos?
                      You can use ANSI escape sequence codes

                      http://en.wikipedia.org/wiki/ANSI_escape_code
                      >
                      Only if you're using an ANSI-compatible terminal or emulator.
                      >
                      --
                      Keith Thompson (The_Other_Keit h) kst-u@mib.org
                      <http://www.ghoti.net/~kst>
                      San Diego Supercomputer Center <*>
                      <http://users.sdsc.edu/~kst>
                      We must do something. This is something. Therefore, we must do this.

                      Comment

                      • mcalhoun@ksu.edu

                        #12
                        Re: text color

                        >what is the name of the function to change the text color when programming
                        >in C under msdos?
                        >You can use ANSI escape sequence codes
                        That's the way I do it, and it's programming-language independent.
                        If the "escape" characters make it -- the FIRST line should be
                        ^[ (as one character) followed by [2J and so on -- you can TYPE
                        the following stuff (between the "cut here" lines) to see what
                        ANSI can do for you. (And if the escape characters do NOT make
                        it, let me know and I'll substitute some character that WILL
                        make it through and you can re-substitute back to the escapes.)

                        ---------- cut here ---------- cut here ---------- cut here ----------
                        
                        Normal Red on black Normal Green on black
                        High Red on black High Green on black
                         Grey on black Normal Blue on black is not very readable
                         White on black High Blue on black
                         Orange on black Normal Magenta on black
                         Yellow on black High Magenta on black
                        Normal Cyan on black High Cyan on black High Cyan on grey
                        
                        +-0 = White on black ("Normal") [same as Low]
                        | 1 = High-intensity text
                        ESC[xm Screen INTENSITY: x=+ 2 = Low -intensity text [same as "Normal"
                        +-0 = Black | 5 = Blink or high-intensity background [bright!]
                        | 1 = Red | 7 = Inverse (black on white) [nope]
                        | 2 = Green +-8 = Invisible text (fore- & back-ground same)
                        ESC[3x;4ym COLOR:+ 3 = Orange [nope]
                        | 4 = Blue These can be combined:
                        x=foreground | 5 = Magenta ESC[1;5m = hi-intensity blinking foreground
                        y=background | 6 = Cyan ESC[1;2;31;42m etc.
                        +-7 = White
                        ---------- cut here ---------- cut here ---------- cut here ----------

                        --Myron.
                        --
                        --Myron A. Calhoun.
                        Five boxes preserve our freedoms: soap, ballot, witness, jury, and cartridge
                        NRA Life Member and Rifle, Pistol, & Home Firearm Safety Certified Instructor
                        Certified Instructor for the Kansas Concealed-Carry Handgun license

                        Comment

                        • kondal

                          #13
                          Re: text color


                          mcalhoun@ksu.ed u wrote:
                          what is the name of the function to change the text color when programming
                          in C under msdos?
                          You can use ANSI escape sequence codes
                          >
                          That's the way I do it, and it's programming-language independent.
                          If the "escape" characters make it -- the FIRST line should be
                          ^[ (as one character) followed by [2J and so on -- you can TYPE
                          the following stuff (between the "cut here" lines) to see what
                          ANSI can do for you. (And if the escape characters do NOT make
                          it, let me know and I'll substitute some character that WILL
                          make it through and you can re-substitute back to the escapes.)
                          >
                          ---------- cut here ---------- cut here ---------- cut here ----------
                          
                          Normal Red on black Normal Green on black
                          High Red on black High Green on black
                           Grey on black Normal Blue on black isnot very readable
                           White on black High Blue on black
                           Orange on black Normal Magenta on black
                           Yellow on black High Magenta on black
                          Normal Cyan on black High Cyan on black High Cyan on grey
                          
                          +-0 = White on black ("Normal") [same as Low]
                          | 1 = High-intensity text
                          ESC[xm Screen INTENSITY: x=+ 2 = Low -intensity text [same as "Normal"
                          +-0 = Black | 5 = Blink or high-intensity background [bright!]
                          | 1 = Red | 7 = Inverse (black on white) [nope]
                          | 2 = Green +-8 = Invisible text (fore- & back-ground same)
                          ESC[3x;4ym COLOR:+ 3 = Orange [nope]
                          | 4 = Blue These can be combined:
                          x=foreground | 5 = Magenta ESC[1;5m = hi-intensity blinking foreground
                          y=background | 6 = Cyan ESC[1;2;31;42m etc.
                          +-7 = White
                          ---------- cut here ---------- cut here ---------- cut here ----------
                          >
                          --Myron.
                          --
                          --Myron A. Calhoun.
                          Five boxes preserve our freedoms: soap, ballot, witness, jury, and cartridge
                          NRA Life Member and Rifle, Pistol, & Home Firearm Safety Certified Instructor
                          Certified Instructor for the Kansas Concealed-Carry Handgun license
                          Please don't snip attribution lines. I learnt the meaning/reason from
                          Keith Thompson once.

                          -kondal

                          Comment

                          Working...