CMFILTER, CMCLRFILTER

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

CMFILTER, CMCLRFILTER

Post by trmpluym » Wed Jun 15, 2016 8:56 pm

According to the xHarbour documentation the old ClipMore filter functions are included. For example:

CMFILTER, CMCLRFILTER
2016-06-16 07_49_25-Main.png
2016-06-16 07_49_25-Main.png (49.23 KiB) Viewed 7007 times
The library is dbrmap.lib and the source should be cmcompat.prg

But i cannot find both (also not dbrmap.a) in HMG 3.4.3.

When i compile a prg with the function the message is:

undefined reference to `HB_FUN_CMFILTER'

Anybody knows where i can find them so i can use the functions ?

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

Post by trmpluym » Sun Jan 29, 2017 8:08 pm

Nobody ?

User avatar
Rathinagiri
Posts: 5130
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 116 times
Been thanked: 115 times
Contact:

Post by Rathinagiri » Mon Jan 30, 2017 4:09 am

I think you have to create a small library with CMFilter function inside of it.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

Post by trmpluym » Mon Jan 30, 2017 7:12 am

Thanks Rathi,

I understand i have to add an additional library or even compile my own. So i need the right library or source file.

According to the xHarbour help file the library is dbrmap.lib and de source file is cmcompat.prg.

I searched for cmcompat.prg and dbrmap.lib and dbrmap.a in the sources but without result.

I also download the latest xHarbour source (http://www.xharbour.org/index.asp?page=download/sources) but i cannot find it there also.

Also i searched all prg source files for the word cmfilter but without result.

Theo

User avatar
serge_girard
Posts: 1784
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 241 times
Been thanked: 56 times
Contact:

Post by serge_girard » Mon Jan 30, 2017 8:39 am

Never heard of it!

Serge

User avatar
mol
Posts: 2778
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 106 times
Been thanked: 41 times
Contact:

Post by mol » Mon Jan 30, 2017 9:29 am

It's written it's fast working filter. It would be nice to test it.

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

Post by trmpluym » Mon Jan 30, 2017 10:08 pm

Hi Serge,

Here the explanation from the original ClipMore manual:
Overview
------------------------------------------------------------------------------

This section provides a model of how ClipMore operates. This is intended to
give you a conceptual framework so that you can best utilize ClipMore's
capabilities. The Function Reference chapter covers the details of
ClipMore.

ClipMore is intended to speed up selective access to records. Selective
access means those cases where you want to only access records which meet a
FOR condition, FILTER condition or fall within a SEEK/WHILE range.

How Clipper Operates Alone

Consider a specific case where you have done a SET FILTER TO, and are then
doing a dbedit(). When you press Down Arrow to move to the next record,
Clipper will look at the next record and determine if it meets the filter
condition. If it does, it stops at that record. However, if the record
doesn't meet the condition, Clipper skips to the next record, and repeats
the process until it finds a record which meets the condition.

This identical process is followed whenever you use a FOR condition. Clipper
simply skips through the records until it finds a record which meets the FOR
condition.

If almost all records meet the condition the time required is negligible.
However, if only 1 out of a 100 records meets the FILTER (or FOR) condition,
it takes a considerable length of time to get the next record.

This problem can be so bad that a filter condition is considered taboo in
many circles. ClipMore alleviates this problem.

How ClipMore Operates

ClipMore uses all available indexes to determine which records meet the
condition (it does not need to access the actual records). This capability
is provided by the cmFilter() function. For example, in Clipper, you might
specify:

set filter to <condition>

Using ClipMore, you would instead specify:

cmFilter("<condition>")

The cmFilter() function parses your condition, determines what indexes are
available, and uses the indexes to determine exactly what records meet the
condition.

ClipMore now knows which records meet the condition. So, whenever you skip,
ClipMore only stops on records which meet the condition. No time is wasted
retrieving records which don't meet the condition.

So, each time Clipper skips to another record it finds a record which meets
the condition. No time is wasted going through 100 records which don't meet
the condition. This is how ClipMore achieves its performance gain.

The cmFilter() function has the identical effect of a SET FILTER TO, but is
_much_ faster.

Summary

Clipper (without ClipMore) inspects each record to determine which records
meet the condition. If there is no master index, the records are examined
in record number order. If there is a master index, the records are
examined in the order specified by the master index.

ClipMore improves Clipper's performance through the cmFilter() function.
cmFilter() analyzes your condition and uses all available indexes to rapidly
determine the records that meet the condition. This process is fast because
the actual database records need not be retrieved; instead the information
in the available indexes is used directly to determine which records meet
the condition.

ClipMore then helps Clipper skip directly to records which meet the
condition; not time is wasted accessing records which don't meet the
condition.
So it works like 'SET FILTER TO' but now 'on steroids' :D

Theo

User avatar
serge_girard
Posts: 1784
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 241 times
Been thanked: 56 times
Contact:

Post by serge_girard » Tue Jan 31, 2017 9:17 am

Thx Theo !

Serge

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

Post by trmpluym » Thu Feb 02, 2017 5:59 pm

Dear HMG friends,

I could not find the source file cmcompat.prg. But i found the latest Comix Clipmore patch cmax53.zip over here:

https://harbour.github.io/the-oasis/ftppatch.htm

I modified the file a little (see attachement f_CM.zip) and now we can use the Clipmore functions like cmFilter in HMG :D

Theo
Attachments
f_CM.zip
(1.12 KiB) Downloaded 57 times
cmax53.zip
(7.86 KiB) Downloaded 54 times

User avatar
mol
Posts: 2778
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 106 times
Been thanked: 41 times
Contact:

Post by mol » Thu Feb 02, 2017 8:40 pm

Great news!
Many thanks for sharing!

Post Reply