One of those browsers show the contents of a dbf called parts (stock info) with a few virtual column showing the price retrieved from another dbf using the partnumber of the stock dbf, added like this for each column, where aList contains the keys for each pricelist:
Code: Select all
oColumn := bVirtualFieldColumn{SELF:oDCBrowser,odbsServer,{|oServer,cList| oServer:GetPricelistValue(cList)},#Expression,aLists[ni]}
Code: Select all
local cCond as string
cCond:="Server:RecNo%2=0"
oColorCondition := bColorCondition{cCond,oColumn:Server,Color{COLORRED}}
oColorCondition:SelectedForeground:=Color{COLORRED}
oColumn:ColorCondition:Add(oColorCondition)
I changed the 1st+2nd line as follows:
Code: Select all
local oCond as CodeBlock
oCond:={|oServer|oServer:SomeMethod}
oColorCondition := bColorCondition{oCond,oColumn:Server,Color{COLORRED}}
Code: Select all
METHOD SomeMethod CLASS Parts
LOCAL lRet AS LOGIC
lRet:=SELF:RECNO%2=0 // SHould return true (and color red) for every second record of parts.dbf
Return lRet
Eventually the method should look up the partnumber in the pricelist dbf and return true or false depending on the return result. But if it already doesn't alternate the colors, I apparently should do something else. Can anyone point me in the right direction?
Dick