Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Proclip2 Library - <b> getcolor() </b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 GETCOLOR() 


          GETCOLOR goes to the screen location specified in the parameters
          and obtains the current color attribute.  This attribute is then
          returned to your program in the form of a standard Clipper
          character string compatible with the SET COLOR TO format (eg.
          '+gr/b').  The function may optionally "flip" the color attribute
          in that the returned string will be the exact inverse of what is
          actually there (eg. '+b/gr').


      Format: 

               <memvar> = getcolor(row, col [,flip])


      Parameters: 

               row.......Numeric variable or constant which, when combined
                         with COL, informs the function of the screen
                         location from which to obtain the current color.

               col.......Numeric variable or constant which, when combined
                         with ROW, informs the function of the screen
                         location from which to obtain the current color.

               flip..... OPTIONAL .  Logical variable or constant which
                         instructs the function as to whether to invert the
                         color attribute before returning it

                         .T.            Force the attribute to invert (flip)
                                        itself.  For example, a color of
                                        '+w/b' would be flipped to be '+b/w'.

                         .F.            DEFAULT.  Do not flip the color
                                        attribute, return it as it actually
                                        is.

      Examples: 

               1.   After your application program loads you wish to obtain
                    the current screen color so it may be restored before
                    your application completes.  (The color of the screen
                    BEFORE your program invoked it's colors was bright yellow
                    text on a blue background)

                    doscolor = getcolor(0,0)
                    * now doscolor = '+gr/b'
                    .
                    .
                    set color to &mycolors
                    clear
                    .
                    .
                    (application program)
                    .
                    .
                    set color to &doscolor
                    quit


      Returns: 

               memvar....A character string variable which will contain a
                         text description of the current color at the
                         position selected.  If nothing is returned an error
                         was detected in your screen coordinates.  The valid
                         range is (0,0) thru (24,79).


                          (Possible Return Color Values)
                          black                          n
                          blue                           b
                          green                          g
                          cyan                           bg
                          red                            r
                          magenta                        rb
                          brown                          gr
                          white                          w
                          intense                        +
                          blink                          *


      Cautions: 

               None.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson