Question

This forum is for eXpress++ general support.
Post Reply
Message
Author
Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Question

#1 Post by Wolfgang Ciriack »

Hello,
i create DCBrowses for arrays in a loop. How can i access an element (ELEMENT 6) of the browse for getting the number for the color in the DCBrowsecol ?

Code: Select all

for i:=1 to lastbrw

   cBrw:="oBrw"+strzero(i,3)
   spa:=(i-1-x)*22.5

   @zl,spa DCBROWSE &cBrw ;
     DATA aKfz[i][5] ;
     POINTER nPointer ;
     HEADLINES 2 ;
     SIZE 21,14.5 ;
     FONT "10.Arial Fett" ;
     PRESENTATION aPP ;
     TABSTOP ;
     NOHORIZSCROLL ;
     TAGENABLE ;
     TAGELEMENT 3 ;
     TAGCOLOR GRA_CLR_YELLOW, GRA_CLR_DARKGRAY ;
     TAGMODE DCGUI_TAGMODE_CLEAR

      DCBROWSECOL ELEMENT 1 ;
            HEADER aKfz[i][2]+";"+aKfz[i][3] ;
            WIDTH 15 ;
            CARGO i ;
            FONT "9.Arial" ;
            DRAG {|o| aDragData:=GetDragData(o)} DIALOG {|mp1,mp2,oXbp| Drag2Auftrag(mp1,mp2,oXbp,aDragData)} ;
            DROP {|o,a,mp1,mp2,nOffset| DropAuftrag(o,a,mp1,mp2,nOffset), dc_getrefresh(Getlist), _SetFocus(o:Cargo[3], lastbrw) } ;
            PARENT &cBrw ;
            COLOR {||     ??????????   <--- here i want to set the color, which is element 6 in the array aKfz[i, 5, nP]
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Question

#2 Post by rdonnay »

Try this:

COLOR {|oBrowse,x| x := oBrowse:dataSource[oBrowse:arrayElement[6]], ;
IIF( x = <something>, {color1,color2},{color3,color4} )}
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Question

#3 Post by Wolfgang Ciriack »

Hi Roger,
it seems, that oBrowse is not passed to the COLOR codeblock.
This does not work :(
_______________________
Best Regards
Wolfgang

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Question

#4 Post by Auge_Ohr »

hi,

as i can say COLOR use no Codeblock just

Code: Select all

      [;DC_GetListSet(DCGUI_GETLIST,aGETLIST_COLOR,{<bncFgC>,<ncBgC>})]     ;
i don't know what is in Element 6. i use a Number in this Sample

Code: Select all

COLOR IF(oBrowse:dataSource[oBrowse:arrayElement[6]] =1 ,{color1,color9},;
      IF(oBrowse:dataSource[oBrowse:arrayElement[6]] =2 ,{color2,color9},;
      IF(oBrowse:dataSource[oBrowse:arrayElement[6]] =3 ,{color3,color9},;
      {color1,color2} ))) 
greetings by OHR
Jimmy

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Question

#5 Post by Wolfgang Ciriack »

Hello Jimmy,
i use codeblocks for COLOR a lot, that works. My problem is the loop and the browse object &cBrw (oBrw001, oBrw002, and so on).
So dc_getcolarray(...) and other tried codeblocks with nPointer does not work and therefore i asked, how i can access the element 6 of the array.
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Question

#6 Post by rdonnay »

it seems, that oBrowse is not passed to the COLOR codeblock.
I failed to notice that your color block was attached to a COLUMN.

Try this:

COLOR {|a,oColumn,oBrowse,x| oBrowse := oColumn:parent, ;
x := oBrowse:dataSource[oBrowse:arrayElement[6]], ;
IIF( x = <something>, {color1,color2},{color3,color4} )}
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Question

#7 Post by Wolfgang Ciriack »

Hello Roger,
thanks for your help, with a small change this works:

x := oBrowse:dataSource[oBrowse:arrayElement, 6]
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Question

#8 Post by rdonnay »

Merry Christmas
The eXpress train is coming - and it has more cars.

Post Reply