Page 1 of 1

Arraybrowser

Posted: Thu May 09, 2013 1:23 am
by c-tec
Hello,
I stuck on little problem with codeblocks for array browsing. I have an array browser where I want to mark lines. But when I change the check value of one line, in the browser all elements are displayed as marked or unmarked. When checking the array the values are ok, only the browser displays the wrong values. Have also tried to put the codeblock in a separate function, the same result.

Code: Select all

@ 2,0 dcbrowse oBrowse size 100,30 data aFields POINTER nPointer ...
DCBROWSECOL DATA {||iif(aFields[nPointer,1],"ok","  ")} WIDTH 1  PARENT oBrowse  HEADER "Sel" 
...
@ 33,_col() DCPUSHBUTTON CAPTION "F3=Mark"        SIZE 15,1.5 ACTION {||aFields[nPointer,1] := !aFields[nPointer,1],dc_getrefresh(oBrowse)}  
regards
Rudolf

Re: Arraybrowser

Posted: Thu May 09, 2013 7:29 am
by rdonnay
nPointer doesn't change when each browse row is painted.

You need to use DC_GetColArray() or oBrowse:arrayElement.

Code: Select all

@ 2,0 dcbrowse oBrowse size 100,30 data aFields POINTER nPointer ...
DCBROWSECOL DATA {||iif(aFields[oBrowse:arrayElement,1],"ok","  ")} WIDTH 1  PARENT oBrowse  HEADER "Sel"

Re: Arraybrowser

Posted: Fri May 10, 2013 3:34 am
by c-tec
Hello Roger,
thank you, works now
regards
Rudolf