>>lparameter tValue >>local lnColor >>do case >> case tValue=x >> lnColor=rgb(....) && Red >> case tValue=y >> lnColor=rgb(...) && Blue >> etc... >>endcase >>return m.lnColor>
*!* Temp.MyGetColor() >LPARAMETERS tvValue >DO CASE > CASE tvValue = "31011 " > ln = RGB(255,0,0) > CASE tvValue = "31036 " > ln = RGB(128,255,0) > OTHERWISE > ln = RGB(128,0,128) >ENDCASE >RETURN ln>
=thisform.GetMyColor(EVAL(this.controlsource))
, method executes as I expect but when it returns I get the error: Error loading file...DynamicBackColor: Data type is invalid for this property
thisform.GetMyColor(EVAL(this.controlsource))
I get Expression is invalid. Use a valid expression for DYNAMICBACKCOLOR property
and the method is not even called.dodefault() this.setall('DynamicForeColor', "this.myforecolor(BldMstr."+thisform.AddrField+")", 'Column') * .Setall('Sparse',.F.) set message to thisform.captionand here is the MyForeColor method of the grid:
******************************************************************** * Description.......: grdAddrStd.myForeColor - sets grid's forecolor depending on Status field value * Calling Samples...: * Parameter List....: * Created by........: Nadya Nosonovsky 06/29/01 11:31:54 PM * Modified by.......: ******************************************************************** lparameter tcFieldVal local lnColor if vartype(m.tcFieldVal)"C" tcFieldVal=evaluate('BldMstr.'+thisform.AdddrField) endif * -- changed the fore color of the whole row * -- red = auto suspect * -- blue = manually resolve * -- green auto-correct * -- highlight the selected line light blue ... *-------------------------------------------------------------------------- local lnColor do case case m.tcFieldVal='5' lnColor=rgb(255,0,0) && Auto-suspect case m.tcFieldVal='4' lnColor=rgb(0,128,0) && Auto-correct case m.tcFieldVal='6' && Manually-resolved lnColor=rgb(0,0,255) otherwise lnColor=rgb(0,0,0) && Black endcase return m.lnColor