xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

GetPairLen()

Returns the length of a color value within a color string.

Syntax

GetPairLen( <cColorString>, <nPos> ) --> nLength

Arguments

<cColorString>
This is a SetColor() compliant character string holding color values as a comma separated list.
<nPos>
This numeric value specifies the ordinal position of the color value to find in <cColorString>. The first color value in the color string has the ordinal position 1.

Return

The function returns the length of th color value at position <nPos> in the passed color string as a numeric value.

Info

See also:GetClrPair(), GetPairPos(), SetColor()
Category: Screen functions
Source:rtl\color53.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe