CMFILTER, CMCLRFILTER

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

CMFILTER, CMCLRFILTER

Post by trmpluym »

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 12091 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: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: CMFILTER, CMCLRFILTER

Post by trmpluym »

Nobody ?
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: CMFILTER, CMCLRFILTER

Post by Rathinagiri »

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: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: CMFILTER, CMCLRFILTER

Post by trmpluym »

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: 3158
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CMFILTER, CMCLRFILTER

Post by serge_girard »

Never heard of it!

Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: CMFILTER, CMCLRFILTER

Post by mol »

It's written it's fast working filter. It would be nice to test it.
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: CMFILTER, CMCLRFILTER

Post by trmpluym »

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: 3158
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CMFILTER, CMCLRFILTER

Post by serge_girard »

Thx Theo !

Serge
There's nothing you can do that can't be done...
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: CMFILTER, CMCLRFILTER

Post by trmpluym »

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 308 times
cmax53.zip
(7.86 KiB) Downloaded 308 times
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: CMFILTER, CMCLRFILTER

Post by mol »

Great news!
Many thanks for sharing!
Post Reply