| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the length of a color value within a color string.
GetPairLen( <cColorString>, <nPos> ) --> nLength
The function returns the length of th color value at position <nPos> in the passed color string as a numeric value.
| See also: | GetClrPair(), GetPairPos(), SetColor() |
| Category: | Screen functions |
| Source: | rtl\color53.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example lists the length of all color values
// in a color string of eight color values.
PROCEDURE Main
LOCAL i, cColor := "W/R,W/G,W/B,W+/R,W+/G,W+/B,W/BG,W+/BG"
FOR i:=1 TO 8
? GetPairLen( cColor, i )
NEXT
** output
// 3
// 3
// 3
// 4
// 4
// 4
// 4
// 5
RETURN
http://www.xHarbour.com