Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . Technical Reference - <b>_gtgetcolorstr()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _gtGetColorStr()
 Get the CA-Clipper color attributes setting
------------------------------------------------------------------------------
 C Prototype

     #include "gt.api"
     ERRCODE _gtGetColorStr(
                             BYTEP fpColorString
                           )

 Arguments

     fpColorString is a null-terminated character string of at least 64
     bytes that receives the current CA-Clipper color attributes setting.
     The constant CLR_STRLEN can be used to allocate a string of correct
     size.

 Returns

     _gtGetColorStr() returns zero if successful.  Any other value indicates
     an error.

 Description

     _gtGetColorStr() saves the current CA-Clipper color attributes setting
     as a null-terminated character string, fpColorString.  You can later use
     fpColorString with _gtSetColorStr() to return the color setting to its
     prior value.  For information on how fpColorString is formatted and the
     meanings of the various color codes, see the _gtSetColorStr() entry in
     this chapter.

 Examples

     .  This example saves the current color setting before changing
        it, displays a string using the new color setting, and restores the
        original color setting:

        #include "gt.api"

        void PrintStr( USHORT uiRow, USHORT uiCol, BYTEP fpStr,
                       BYTEP fpColor );

        void PrintStr( USHORT uiRow, USHORT uiCol, BYTEP fpStr,
                       BYTEP fpColor )
        {
           BYTE cSavColor[ CLR_STRLEN ];
           USHORT uiSavRow;
           USHORT uiSavCol;

           _gtGetPos( &uiSavRow, &uiSavCol );    // Save coordinates
           _gtGetColorStr( cSavColor );          // Save color setting

           _gtSetColorStr( fpColor );
           _gtSetPos( uiRow, uiCol );
           _gtWrite( fpStr, strlen( fpStr ) );

           _gtSetColorStr( cSavColor );          // Restore color setting
           _gtSetPos( uiSavRow, uiSavCol );      // Restore coordinates
        }

 Files:  Library is CLIPPER.LIB, header file is Gt.api.


See Also: _gtColorSelect() _gtGetPos() _gtIsColor() _gtSetColorStr()

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