Tagging and filter records

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Tagging and filter records

#1 Post by Victorio »

Hi,

I want select records with tag, with internal variable, no with field TAG.
(In DCBROWSE I have TAGENABLE and TAGELEMENT 35)

If I tagging records in browser, and then I filter it with set filter to xxx
program show selected records. It is ok.
(I used SET FILTER TO MYDATABASE->(DC_Tagged()) )

But If I have many records (200000-500000), time to show selected records is long.

Also if put field TAG Logical to my database and before opening I have used DC_Rectagclear(), this also is very long time (program show notify about clear tagging...).

I mean use scope, but do not know, what I can use tag variable. Because I have not TAG field in database I cannot index with it and use scope.

Is some other way ?
Thanks

skiman
Posts: 1194
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tagging and filter records

#2 Post by skiman »

Hi,

Are you browsing a database? Is so the DC_RecTagToggle() is used to add your tagged records to an array.

Afterwards just use the dc_setscopearray(DC_RecTagToggle()) to set the browse to select the tagged records.

Clearing the array can be done by DC_RecTagToggle({})

Clearing the scope is dc_setscopearray(nil)
Best regards,

Chris.
www.aboservice.be

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Tagging and filter records

#3 Post by Victorio »

Hi Chris,

I am not understand, how I can do it.
I have browse database,
* browse okienko Identifikácie
@pozyid,10 DCBROWSE oBrowseid ALIAS "IDENT" ;
SIZE rozxid,rozyid PIXEL ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW ;
SCROLLBARHEIGHT 12 ;
TAGENABLE ;
TAGELEMENT 35 ;
TAGCOLOR GRA_CLR_RED, GRA_CLR_YELLOW ;
TAGMODE DCGUI_TAGMODE_CLEAR

DCSETPARENT oBrowseid

* ukážka aj tak sa dá, použiť pre pole premenná z poľa array - info roger donay
*DCBROWSECOL DATA DC_FieldWBlock(pic[1],"1") WIDTH 10;
* HEADER hic[1] PARENT oBrowsepa

* polia preusporiadané aby bolo vidno najprv základné veci
* zistiť, či sa dá povoliť prehodenie polí v browseri podobne ako v exceli
DCBROWSECOL FIELD IDENT->CPACI ;
HEADER "C-PA z IDF" WIDTH znakpixc[1]*14
DCBROWSECOL FIELD IDENT->CPAEI ;
HEADER "E-PA z IDF" WIDTH znakpixc[1]*14
DCBROWSECOL FIELD IDENT->CLVC ;
HEADER "C-PA-CLV" WIDTH znakpixc[1]*7
DCBROWSECOL FIELD IDENT->CLVE ;
HEADER "E-PA-CLV" WIDTH znakpixc[1]*7

etc.

then in toolbar button to "SELECT". First I mark records (with SPACE and mouse click or CTRL and mouse click)
Selected records will be Yellow.

Then click button SELECT, this do
SET FILTER TO IDENT->(DC_Tagged())

records is filtered, show only selected.

I examine clear SET FILTER TO IDENT...m and put DC_SETSCOPEARRAY(DC_RECTAGTOGGLE()), but nothing do, all records is showing. Must I change to browse no database but array ? where is "copy" of tagged records ?

So I mean, more changes in source I must do , ?



Note: I have not TAG field, in database, then, If I understand good, express use DCTAG array ? as a public variable .

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

Re: Tagging and filter records

#4 Post by rdonnay »

You should use DC_ScopeArray( DC_RecTagArray() )
The eXpress train is coming - and it has more cars.

skiman
Posts: 1194
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tagging and filter records

#5 Post by skiman »

Hi,

Sorry, I typed the wrong function as Roger already corrected.
Then click button SELECT, this do
SET FILTER TO IDENT->(DC_Tagged())
Action of this button should be: ident->(DC_ScopeArray( DC_RecTagArray() ))
Best regards,

Chris.
www.aboservice.be

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Tagging and filter records

#6 Post by Victorio »

Roger, Chris, thanks, speed with DC_SetScopeArray(DC_RecTagArray()) is super !.
Browse table is ok, only selected view.

But now I have not filtered records for next processing, need change some procedures in source , in cycle for processing records put
do while eof()
if DC_Tagged()
* some process
endif
skip
enddo

this work fine too.

skiman
Posts: 1194
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tagging and filter records

#7 Post by skiman »

Hi,

You don't need to check for dc_tagged. With dc_setscopearray only the tagged records are in the list. You also need to use the dc_db... commands.

Code: Select all

ident->(dc_dbgotop())
do while !ident->(dc_eof())
* some process
ident->(dc_dbskip(1))
enddo
Best regards,

Chris.
www.aboservice.be

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Tagging and filter records

#8 Post by Victorio »

skiman :
I examine this :
ident->(dc_dbgotop())
do while !ident->(dc_eof())
* some process
ident->(dc_dbskip(1))
enddo

but dc_dbskip no work, I do not understand why. If I use skip and if dc_tagged() .. works.

Also, I do not understant how is define array DCTAGS ? It is multidimensional array ?
How structure have it ?

Next problem is, because I have two way to filtering data, with TAG (mark records) on table, and also with filter.
Then it is problem because records may be filtered by filter and also with tag.

skiman
Posts: 1194
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tagging and filter records

#9 Post by skiman »

Hi,

You have ident->(DC_ScopeArray( DC_RecTagArray() )) above dc_dbgotop())?
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1194
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tagging and filter records

#10 Post by skiman »

Next problem is, because I have two way to filtering data, with TAG (mark records) on table, and also with filter.
Then it is problem because records may be filtered by filter and also with tag.

Code: Select all

ident->(DC_ScopeArray( DC_RecTagArray() ))
ident->(dc_dbgotop())
do while !ident->(dc_eof())
 if eval(bFilter)
   * some process
 endif
ident->(dc_dbskip(1))
enddo
Best regards,

Chris.
www.aboservice.be

Post Reply