From: Kevin on 3 Jun 2010 05:04 I think there was some confusion in relation to my original posting. In my original post I had what I considered to be three different conditions, identified below as A, B and C. Conditions A and B were working as expected but C was not. Condition A oColorCond := bColorCondition{"upper(Server:State) = 'SUBMITTED'", self:Server, , Brush{Color{0,192,0}}} oBrw:ColorCondition:Add( oColorCond ) Condition B oColorCond := bColorCondition{"upper(Server:State) = 'RECEIVED'", self:Server, , Brush{Color{192,192,192}}} oBrw:ColorCondition:Add( oColorCond ) Condition C oColorCond := bColorCondition{"Server:Litres > 0.00", self:Server, Color{COLORBLUE}} oBrw:ColorCondition:Add( oColorCond ) My understanding what you and Stephen were saying was that if condition A returned true then conditions B and C would not be run. I set up a small app using a bArrayServer using the same conditions and it worked. I now think that you were both referring to a condition as the first parameter of the bColorCondition. For example, if the first parameter was "Server:Litres > 0.00 or Server:State = 'S'". In this case if the Litres is 0 then condition fails and the State is not checked. This I knew and understood. FWIW - changing the order of the conditions (as I was thinking of them) has given the expected result. Thanks for the pointers. Kevin "Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message news:KGsNn.673$Ls1.263(a)news-server.bigpond.net.au: > Kevin, > > Read the pages on bBrowser:ColorCondition, bDataColumn:ColorCondition > and the various links that follow on from these pages. But when you read > the bColorCondition:Eval() the Init methods and the samples. I guess it > isn't in one place but I always read the source code where there are > even more comments. > > Geoff > > > > "Kevin" <kdmurphy(a)eircom.net> wrote in message > news:F8sNn.116$K4.115(a)news.indigo.ie: > > > Geoff, > > > > I never really had to think about it as I did not have many colour > > conditions and this never happened before. The way it works now makes > > sense following Stephen's and your replies. > > > > Where in the help file does it state the way the conditions work? I can > > see that the conditions are added to a list but I cannot see where it > > explains how that list is processed and that when one condition returns > > true, the remaining items in the list are not processed. If that is > > there I have managed to miss it. > > > > Kevin > > > > > > "Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message > > news:tarNn.637$Ls1.279(a)news-server.bigpond.net.au: > > > > > > > Kevin, > > > > > > No - that wouldn't make sense because you would never be able to predict > > > the outcome. You'd be stuck working out some complex hierarchy to apply. > > > But also, it is very clearly documented in the Help file. The Help is > > > worth reading through cover to cover, at least 3 times. I still pick up > > > new stuff... (as well as scouring the source code for ideas and clues). > > > > > > Columns override browser override defaults. > > > But the column always wins. > > > > > > Cheers, > > > > > > Geoff > > > > > > > > > > > > "Kevin" <kdmurphy(a)eircom.net> wrote in message > > > news:WrqNn.114$K4.125(a)news.indigo.ie: > > > > > > > > > Stephen, > > > > > > > > Okay thanks. > > > > > > > > I had assumed that the conditions were added to a list and each run > > > > rather than it stopping at the first condition that returns true. > > > > > > > > Thanks again. > > > > > > > > Kevin > > > > > > > > "Stephen Quinn" <stevejqNO(a)bigpondSPAM.net.au> wrote in message > > > > news:VQpNn.612$Ls1.301(a)news-server.bigpond.net.au: > > > > > > > > > > > > > > > Kevin > > > > > > > > > > > > > > > > > If you look at my original post you will see that the third condition is > > > > > > on a different column, and it does not work. Changing the third condition > > > > > > to first, it works and the other two don't. From what you are saying it > > > > > > should work but doesn't. > > > > > > > > > > > Nope - your ADDing it to the BROWSER > > > > > - oBrw:ColorCondition:Add( oColorCond ) > > > > > > > > > > When adding conditions to the browser they are evaulated in the order added, > > > > > when one evaluates to TRUE the evaulation sequence is ended. > > > > > > > > > > I can see what the problem is now with the extra info you provided. > > > > > What I showed was the foreground/background colour change for the ROW (4 > > > > > conditions) > > > > > > > > > > If you want to affect the forground of a single column then you apply the > > > > > condition to the COLUMN not the BROWSER. > > > > > Eg > > > > > oCol := oBrw:GetOpenColumn( #LITRES ) > > > > > > > > > > oColorCond := bColorCondition{"Server:Litres > 0.00", self:Server, > > > > > Color{COLORBLUE}} > > > > > > > > > > oCol:ColorCondition:Add( oColorCond ) > > > > > > > > > > CYA > > > > > Steve
From: Stephen Quinn on 3 Jun 2010 06:10 Kevin > I now think that you were both referring to a condition as the first > parameter of the bColorCondition. For example, if the first parameter was > "Server:Litres > 0.00 or Server:State = 'S'". > In this case if the Litres is 0 then condition fails and the State is not > checked. Nope - If Litres is zero (FALSE) then State will be checked as it may be TRUE If it was '.AND.' then what you said would be correct. Its conditional logic evaluation on .AND. statements - bail out when any of the conditions are false ..OR. conditions are evaluated until one returns TRUE or they ALL return FALSE > This I knew and understood. CYA Steve
From: Kevin on 3 Jun 2010 07:15 Stephen, That was my mistake, must have left my brain somewhere else <g>. I had meant to put AND in and that was what I was thinking when I wrote it. Just didn't check it before sending. Thanks again. Kevin "Stephen Quinn" <stevejqNO(a)bigpondSPAM.net.au> wrote in message news:bcLNn.857$Ls1.682(a)news-server.bigpond.net.au: > Kevin > > > I now think that you were both referring to a condition as the first > > parameter of the bColorCondition. For example, if the first parameter was > > "Server:Litres > 0.00 or Server:State = 'S'". > > > In this case if the Litres is 0 then condition fails and the State is not > > checked. > > Nope - If Litres is zero (FALSE) then State will be checked as it may be > TRUE > If it was '.AND.' then what you said would be correct. > > Its conditional logic evaluation on .AND. statements > - bail out when any of the conditions are false > > .OR. conditions are evaluated until one returns TRUE or they ALL return > FALSE > > > This I knew and understood. > > CYA > Steve
First
|
Prev
|
Pages: 1 2 3 Prev: How to disable messagebeep (sound) when click listviewitem bymouse ? Next: ADS and ReportPro 2 |