FILTER clause in ARRAY browser

This forum is for eXpress++ general support.
Message
Author
Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

FILTER clause in ARRAY browser

#1 Post 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

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

Re: FILTER clause in ARRAY browser

#2 Post 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.
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: FILTER clause in ARRAY browser

#3 Post 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

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

Re: FILTER clause in ARRAY browser

#4 Post by rdonnay »

Give me a sample program that causes errors.

My sample works fine.
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: FILTER clause in ARRAY browser

#5 Post 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
Attachments
Iscin.zip
(1.91 KiB) Downloaded 533 times

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

Re: FILTER clause in ARRAY browser

#6 Post by rdonnay »

Attached is an updated test program.

Give this a try.
Attachments
iscin.zip
(1.33 KiB) Downloaded 564 times
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: FILTER clause in ARRAY browser

#7 Post by hz_scotty »

Hi Roger,

i found some anomalie in DC_SKIPARRAY in this sample
see attachmend (this is a .PDF - extract it)
Attachments
Error.zip
(107.92 KiB) Downloaded 537 times
best regards
Hans

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: FILTER clause in ARRAY browser

#8 Post 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

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

Re: FILTER clause in ARRAY browser

#9 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: FILTER clause in ARRAY browser

#10 Post 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
best regards
Hans

Post Reply