Page 2 of 2
Posted: Thu Jul 17, 2008 8:40 am
by Antonio Linares
This is the right code:
Code: Select all | Expand
SetTextColor( hDC, If( nColAct != nil, If( ValType( nClrTxt ) == "B",;
Eval( nClrTxt, n ), nClrTxt ),;
If( ValType( nClrText ) == "B", Eval( nClrText, n ), nClrText ) ) )
Posted: Thu Jul 17, 2008 2:26 pm
by Rick Lipkin
Antonio
It appears the nCol is returning NIL for nClrText ( nClrPane works fiine ).. I am trapping the code block and evaluating nCol .. and the msginfo(ncol ) returns NIL in SelColorf()
Rick Lipkin
..
..
oLbx:nClrText = { | nCOL | SelColorF( nCOL, oRsRpt:Fields("row_color"):Value, "F" ) }
oLbx:nClrPane = { | nCOL | SelColorB( nCOL, oRsRpt:Fields("row_color"):Value, "B" ) }
..
//--------------------
Static Func SelColorB( nCOL, cCOLOR, cTYPE )
LOCAL nCOLOR := CLR_WHITE
DO CASE
CASE nCOL = 8 .and. cCOLOR = "GREEN" .and. cTYPE = "B"
nCOLOR := CLR_GREEN
CASE nCOL = 8 .and. cCOLOR = "YELLOW".and. cTYPE = "B"
nCOLOR := CLR_YELLOW
CASE nCOL = 8 .and. cCOLOR = "RED" .and. cTYPE = "B"
nCOLOR := CLR_RED
ENDCASE
RETURN( nCOLOR )
//--------------------
Static Func SelColorF( nCOL, cCOLOR, cTYPE )
LOCAL nCOLOR := CLR_BLACK
MSGINFO( nCOL ) // return NIL here
DO CASE
CASE nCOL = 8 .and. cCOLOR = "GREEN" .and. cTYPE = "F"
nCOLOR := CLR_WHITE
msginfo( nCOLOR )
CASE nCOL = 8 .and. cCOLOR = "YELLOW".and. cTYPE = "F"
nCOLOR := CLR_WHITE
CASE nCOL = 8 .and. cCOLOR = "RED" .and. cTYPE = "F"
nCOLOR := CLR_WHITE
ENDCASE
RETURN( nCOLOR )