| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the absolute position of a color value in a color string.
GetPairPos( <cColorString>, <nPos> ) --> nAbsPos
The function returns the absolute position of the color value at the ordinal position <nPos> in the passed color string as a numeric value.
| Category: | Screen functions |
| Source: | rtl\color53.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example uses function SubStr() to extract a color
// value from a color string
PROCEDURE Main
LOCAL cColor := "W/R,W/G,W/B,W+/R,W+/G,W+/B,W/BG,W+/BG"
LOCAL nAbsPos, nLength
nAbsPos := GetPairPos( cColor, 6 )
nLength := GetPairLen( cColor, 6 )
? SubStr( cColor, nAbsPos, nLength ) // result: W+/B
? GetClrPair( cColor, 6 ) // result: W+/B
RETURN
http://www.xHarbour.com