Function ColorSelect() Foundation

Activate a color value from the current color settings.

ColorSelect( <nColorIndex> ) --> NIL
<nColorIndex> is an integer numeric value which refers to a position in the list of color values set with SetColor(). The list of color values is zero-based, so the position of the first color value in the list is zero.

The return value of ColorSelect() is always NIL.


The function ColorSelect() activates the indicated color pair from the list of colors set with SetColor(). In the file COLOR.CH symbolic constants for<nColorIndex> are defined:

Constants in COLOR.CH
Constant Description
CLR_STANDARD All screen output commands and functions
CLR_ENHANCED Get fields and highlighted items"
CLR_BORDER Screen border (only with EGA and VGA monitors)
CLR_BACKGROUND Not supported
CLR_UNSELECTED Unselected Get fields

ColorSelect() does not change the color settings defined with SetColor().

// The example shows ColorSelect() with the symbolic 
// constants from COLOR.CH and non-symbolic values 

#include "" 

   LOCAL  cColor := "N/BG,BG/N,BG+/R,BG+/G,BG+/B,W+/R,W+/G,W+/B" 
   cColor := SetColor( cColor ) 
   ? "Colors:", SetColor() 
   ? "ColorSelect( CLR_STANDARD )" 

      ColorSelect( CLR_ENHANCED ) 
   ? "ColorSelect( CLR_ENHANCED )" 

      ColorSelect( CLR_BORDER ) 
   ? "ColorSelect( CLR_BORDER )" 

      ColorSelect( CLR_BACKGROUND ) 
   ? "ColorSelect( CLR_BACKGROUND )" 

      ColorSelect( CLR_UNSELECTED ) 
   ? "ColorSelect( CLR_UNSELECTED )" 

      ColorSelect( 5 ) 
   ? "ColorSelect( 5 )" 

      ColorSelect( 6 ) 
   ? "ColorSelect( 6 )" 

      ColorSelect( 7 ) 
   ? "ColorSelect( 7 )" 

      ColorSelect( 0 )              // set default color value 
      SetColor( cColor )            // set old color setting 



If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.