Page 1 of 2

FILTER clause in ARRAY browser

Posted: Sat Aug 09, 2014 10:53 pm
by Janko
Roger,

I have a program that manages customer's orders using ARRAY BROWSER. Some of orders (rows) are marked (during browsing) to be filtered out and not shown at the moment.

1. during browsing array with FILTER clause there is a problem: when last array row is marked to be filtered out, a runtime error is generated.
2. Or situation that before entering the browser all rows are filtered out (so no rows to be shown) : an error is generated.

Is there a simple way to avoid this situation?

BR JAnko

Re: FILTER clause in ARRAY browser

Posted: Sun Aug 10, 2014 6:55 pm
by rdonnay
Janko -

I don't know what version of eXpress++ you are using so I can't tell you what lines of code to change in _DCXBROW.PRG. So here is what I suggest.

Look for the following code in the function DC_SkipArray():

Code: Select all

        DO WHILE !Eval(oBrowse:filter,oBrowse:dataSource[nPointer])
          nPointer --
        ENDDO
        EXIT
Change it to this:

Code: Select all

        DO WHILE nPointer > 0 .AND. !Eval(oBrowse:filter,oBrowse:dataSource[nPointer])
          nPointer --
        ENDDO
        EXIT
Then rebuild DCLIPX.DLL by running BUILD19_SL1.BAT

This fix will be in the next release.

Re: FILTER clause in ARRAY browser

Posted: Mon Aug 11, 2014 5:17 am
by Janko
Roger,

I've applied the ammendment. Now, browser shows empty lines (as expected) but

1. moving mousewheel or pressing 'PgUp' or 'PgDown' generates 'Error in array index'
2. COLOR clause in DCBROWSECOL - COLOR {|| if(dc_getColArray(11,oNaroc),{GRA_CLR_WHITE, GRA_CLR_RED},)} is generating error
3. refreshing of the browser after changes in the number of 'filtered in' records is not correct (leaving blank line on top)

My eXpress version is 258, the line I've changed is 3260.

I hope this corrections will not be very time consuming.

Kind regards
Janko

Re: FILTER clause in ARRAY browser

Posted: Mon Aug 11, 2014 9:17 am
by rdonnay
Give me a sample program that causes errors.

My sample works fine.

Re: FILTER clause in ARRAY browser

Posted: Mon Aug 11, 2014 2:03 pm
by Janko
Roger,

in attachment you can find IsciN.prg, IsciN.xpj and Iscin.arr (two row array file).

In array, col 7 empty mean filter in, '*' mean filter out
Buttons: 'ON', 'OFF' turns filtering on or off
'Zamenjaj znak' changing of col 7 in array

1. step after start press ON/OFF (OFF shows 2 rows, one with '*' in col 7 one empty)
2. step press 'Zamenjaj znak' that both rows are with star in col 7
3. step press 'ON' to activate filter
4. step try mousewheel (up and down) or keyboard

5. step try to uncomment COLOR clause in line 59 and start browser with all rows filtered out.

I do really appreciate your help.

Best regards
Janko

Re: FILTER clause in ARRAY browser

Posted: Mon Aug 11, 2014 5:51 pm
by rdonnay
Attached is an updated test program.

Give this a try.

Re: FILTER clause in ARRAY browser

Posted: Tue Aug 12, 2014 12:13 am
by hz_scotty
Hi Roger,

i found some anomalie in DC_SKIPARRAY in this sample
see attachmend (this is a .PDF - extract it)

Re: FILTER clause in ARRAY browser

Posted: Tue Aug 12, 2014 5:47 am
by Janko
Dear Roger,

one problem remains: when you filter out all rows, browser is empty (as should be) but pressing 'PgUp' or 'PgDown' generates error. As well moving mouseWheel.

Color clause is OK, refreshing is OK.

Can I ask you for this corrections to?

Best regards
JAnko

Re: FILTER clause in ARRAY browser

Posted: Tue Aug 12, 2014 8:41 am
by rdonnay
Here is one more fix for you.

Look for the following code in DC_SkipArray() in _DCXBROW.PRG:

Code: Select all

        DO WHILE !Eval(oBrowse:filter,oBrowse:dataSource[nPointer])
          nPointer ++
        ENDDO
        EXIT
Change it to this:

Code: Select all

        DO WHILE nPointer < Len(oBrowse:dataSource) .AND. !Eval(oBrowse:filter,oBrowse:dataSource[nPointer])
          nPointer ++
        ENDDO
        EXIT
Rebuild DCLIPX.DLL by running BUILD19_SL1.BAT.

This fix will be in the next build.

Re: FILTER clause in ARRAY browser

Posted: Tue Aug 12, 2014 11:40 pm
by hz_scotty
Hello,

another Anomalie

i dont know if it is your Lib or the testfile IsciN.prg

when you start the exe, unmark all rows (with the Zamerjaj znak Button)
then activate the OFF Button (the cursor go to first row)
now activate the "znak button" once
the line disappears - thats ok
now you have only one row
when you activate the "znak button" again - the line was marked but does not disappear

is there a solution proposed