FUNCTIONS CORE

InvertAttr()

Exchange the foreground and background color

Syntax

Signature
InvertAttr( xColor ) --> nInvertedAttribute

Arguments

xColor

Example

InvertAttr.prg
PROCEDURE Main()

   Check( 'InvertAttr( 7 )                       ', InvertAttr( 7 ), 112 )
   Check( 'NToColor( InvertAttr( "W+/B" ), .T. ) ', NToColor( InvertAttr( "W+/B" ), .T. ), "B+/W" )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

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

RETURN

Output

InvertAttr( 7 )                       OK
NToColor( InvertAttr( "W+/B" ), .T. ) OK