FUNCTIONS CORE

GetClrPair()

Extract a color value from a color string

Syntax

Signature
GetClrPair( cColorString, nPos ) --> cColorValue

Arguments

cColorString

nPos

Example

GetClrPair.prg
PROCEDURE Main()

   LOCAL cColors := "W/N,N/W,W+/B"

   Check( 'GetClrPair( cColors, 3 ) ', GetClrPair( cColors, 3 ), "W+/B" )
   Check( 'GetClrPair( cColors, 5 ) ', GetClrPair( cColors, 5 ), "" )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

GetClrPair( cColors, 3 ) OK
GetClrPair( cColors, 5 ) OK