Friends
Sorry about my stuff up with the comma
Of course, it was a typo with rgb(192,19,2,192)

Even so, I can't get it to work
I've even tried
col1="RGB(192,192,192)"
col2="RGB(255,255,255)"
colcond=IIF(AT("BYE",sp605.courtc6)=0,.f.,.t.)
Thisform.Grid1.Columns(7).DynamicBackColor = "IIF(colcond,&col1,&col2)"

I'll now move on




On Thu, Oct 11, 2012 at 6:04 PM, Fred Taylor <[email protected]> wrote:

> xrb="RGB(192,192,192)"
>
> RGB only takes 3 arguments, not 4.
>
> And as a note, it's usually easier to put the code in a method and put the
> method call in the DynamicBackColor property.  Your method should return
> the RGB value.
>
> thisfrom.grid.columnX.DynamicBackColor = "thisform.YourMethodName()"
>
> * thisform.YourMethod
> IF somecondition
>   RETURN RGB(192,192,192)
> ELSE
>   RETURN RGB(255,255,255)
> ENDIF
>
> Fred
>
>
> On Wed, Oct 10, 2012 at 9:49 PM, Sytze de Boer <[email protected]>
> wrote:
>
> > Bill, many thanks for this
> > I have tried to "interprete" this to my situation as follows but I get a
> > message
> > "Too many arguments"
> >
> > Darned if I can see it
> >
> > xrb="RGB(192,19,2,192)"
> > Thisform.Grid1.Columns(1).DynamicBackColor = ;
> > icase(at('BYE',sp605.courtc1) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc2) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc3) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc4) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc5) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc6) <> 0, &xrb, " + ;
> >         "at('BYE',sp605.courtc7) <> 0, &xrb, RGB(255,255,255))"
> >
> > I have counted the brackets and the commas very carefully, but it has me
> > beat
> >
> >
> >
> > On Thu, Oct 11, 2012 at 3:51 PM, Bill Arnold <
> > [email protected]> wrote:
> >
> > > Hi  Sytze,
> > >
> > > Below code sets the grid cell coloring shown here:
> > >
> > >
> > >
> >
> http://www.h2officesolutions.com/h2os_custguide/The_Weekly_Schedule_screen.h
> > > tm
> > >
> > > I've copy/pasted the code below without looking to see what questions
> > this
> > > may evoke, but if you have any,
> > > will be glad to answer
> > >
> > >
> > > Bill
> > >
> > >
> > >
> > >
> > > * This method sets cell backcolors for the JOB TYPE option
> > > * - uses colors as set for the JOB TYPE controls
> > >
> > > * Cannot be used with TIME OF DAY or EMPLOYEE color controls. Each of
> > the 3
> > > color coding groups
> > > * are mutually exclusive with each other..
> > >
> > >
> > > * JTxNAME values = service call, installation, etc. per list
> > > * of job types obtained from go_lmutils method to get job types list
> > >
> > >
> > > rgb_jt1 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt1color))+')'
> > > rgb_jt1 = STRTRAN(rgb_jt1, '"', '')             && remove " marks
> > > rgb_jt1 = STRTRAN(rgb_jt1, ' ', '')             && remove blanks
> > >
> > >
> > >
> > > rgb_jt2 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt2color))+')'
> > > rgb_jt2 = STRTRAN(rgb_jt2, '"', '')             && remove " marks
> > > rgb_jt2 = STRTRAN(rgb_jt2, ' ', '')             && remove blanks
> > >
> > > rgb_jt3 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt3color))+')'
> > > rgb_jt3 = STRTRAN(rgb_jt3, '"', '')             && remove " marks
> > > rgb_jt3 = STRTRAN(rgb_jt3, ' ', '')             && remove blanks
> > >
> > > rgb_jt4 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt4color))+')'
> > > rgb_jt4 = STRTRAN(rgb_jt4, '"', '')             && remove " marks
> > > rgb_jt4 = STRTRAN(rgb_jt4, ' ', '')             && remove blanks
> > >
> > > rgb_jt5 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt5color))+')'
> > > rgb_jt5 = STRTRAN(rgb_jt5, '"', '')             && remove " marks
> > > rgb_jt5 = STRTRAN(rgb_jt5, ' ', '')             && remove blanks
> > >
> > > rgb_jt6 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt6color))+')'
> > > rgb_jt6 = STRTRAN(rgb_jt6, '"', '')             && remove " marks
> > > rgb_jt6 = STRTRAN(rgb_jt6, ' ', '')             && remove blanks
> > >
> > > rgb_jt7 = 'rgb('+ALLTRIM(dec2rgb(wschctls.jt7color))+')'
> > > rgb_jt7 = STRTRAN(rgb_jt7, '"', '')             && remove " marks
> > > rgb_jt7 = STRTRAN(rgb_jt7, ' ', '')             && remove blanks
> > >
> > > * check JT1NAME and JT1COLOR (?)
> > >
> > > * Assign colors to each of the 7 columns (for days of week) across
> > > * the grid
> > >
> > > * Note the use if icase
> > >
> > > * values tested for and assigned are stored in the wschctls table
> > >
> > >
> > > * Sunday column
> > >  Thisform.Grid1.Columns(1).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.sun) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.sun) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.sun) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.sun) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.sun) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.sun) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.sun) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Monday column
> > >  Thisform.Grid1.Columns(2).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.mon) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.mon) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.mon) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.mon) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.mon) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.mon) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.mon) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Tuesday
> > > Thisform.Grid1.Columns(3).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.tue) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.tue) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.tue) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.tue) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.tue) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.tue) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.tue) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Wed
> > > Thisform.Grid1.Columns(4).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.wed) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.wed) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.wed) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.wed) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.wed) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.wed) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.wed) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Thur
> > > Thisform.Grid1.Columns(5).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.thu) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.thu) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.thu) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.thu) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.thu) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.thu) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.thu) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Fri
> > > Thisform.Grid1.Columns(6).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.fri) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.fri) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.fri) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.fri) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.fri) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.fri) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.fri) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > > * Sat
> > > Thisform.Grid1.Columns(7).DynamicBackColor = ;
> > >   "icase(atc(trim(wschctls.jt1name),gridjobs.sat) <> 0, &rgb_jt1, " + ;
> > >    "atc(trim(wschctls.jt2name),gridjobs.sat) <> 0, &rgb_jt2, " + ;
> > >    "atc(trim(wschctls.jt3name),gridjobs.sat) <> 0, &rgb_jt3, " + ;
> > >    "atc(trim(wschctls.jt4name),gridjobs.sat) <> 0, &rgb_jt4, " + ;
> > >    "atc(trim(wschctls.jt5name),gridjobs.sat) <> 0, &rgb_jt5, " + ;
> > >    "atc(trim(wschctls.jt6name),gridjobs.sat) <> 0, &rgb_jt6, " + ;
> > >    "atc(trim(wschctls.jt7name),gridjobs.sat) <> 0,
> > > &rgb_jt7,RGB(255,255,255))"
> > >
> > >
> > >
> > > * add legend
> > >
> > >  thisform.legend1.backcolor = &rgb_jt1
> > >  thisform.legend1.caption = trim(wschctls.jt1name)
> > >  thisform.legend1.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend1.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend1.fontbold = .t.                 && bold font
> > >  thisform.legend1.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend2.backcolor = &rgb_jt2
> > >  thisform.legend2.caption =  trim(wschctls.jt2name)
> > >  thisform.legend2.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend2.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend2.fontbold = .t.                 && bold font
> > >  thisform.legend2.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend3.backcolor = &rgb_jt3
> > >  thisform.legend3.caption =  trim(wschctls.jt3name)
> > >  thisform.legend3.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend3.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend3.fontbold = .t.                 && bold font
> > >  thisform.legend3.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend4.backcolor = &rgb_jt4
> > >  thisform.legend4.caption =  trim(wschctls.jt4name)
> > >  thisform.legend4.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend4.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend4.fontbold = .t.                 && bold font
> > >  thisform.legend4.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend5.backcolor = &rgb_jt5
> > >  thisform.legend5.caption =  trim(wschctls.jt5name)
> > >  thisform.legend5.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend5.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend5.fontbold = .t.                 && bold font
> > >  thisform.legend5.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend6.backcolor = &rgb_jt6
> > >  thisform.legend6.caption =  trim(wschctls.jt6name)
> > >  thisform.legend6.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend6.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend6.fontbold = .t.                 && bold font
> > >  thisform.legend6.fontsize = 12                 && 12 point
> > >
> > >  thisform.legend7.backcolor = &rgb_jt7
> > >  thisform.legend7.caption =  trim(wschctls.jt7name)
> > >  thisform.legend7.forecolor = 0
> > &&
> > > black letters
> > >  thisform.legend7.backstyle = 1                  && label area is
> filled
> > > with backcolor
> > >  thisform.legend7.fontbold = .t.                 && bold font
> > >  thisform.legend7.fontsize = 12                 && 12 point
> > >
> > >
> > >
> > > return
> > >
> > >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cag1nny82uenvazhg2-v8mgfh_9prqjeq_8-ts932qkksgup...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to