[MSEide-MSEgui-talk] General list for MSEide+MSEgui

classic Classic list List threaded Threaded
58 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza

The problem is  on findvariant and when the field to search is not a string.

 

Here what I did.

 

VarVar is a variant;

 

procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;

               const akind: filtereditkindty);

begin

i:=0;

with sender do begin

while (i<fields.count) and (fields[i].isnull) do inc(i);

if i<fields.count then varvar:=fields[i].value;

end;end;

 

procedure tmainfo.afterendfilteredit(const sender: tmsebufdataset;

               const akind: filtereditkindty);

var j:integer;

begin

if akind = fek_find then begin

j:=0;

if not(varisempty(varvar) ) then

with sender do begin

while  (j<indexlocal.count) and (fields[i].fieldname<>indexlocal[j].fields[0].fieldname) do inc(j);

if  ( j< indexlocal.count ) and

    (not indexlocal[j].findvariant([varvar],false,true)) then

     showmessage('*** not found ***');

end; end; end;



_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

General list for MSEide+MSEgui.vcf (3K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
On Tuesday 18 September 2018 11:47:18 mohamed hamza wrote:

> The problem is  on findvariant and when the field to search is not a
> string.
>
> Here what I did.
>
> VarVar is a variant;
>
> procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> begin
> i:=0;
> with sender do begin
> while (i<fields.count) and (fields[i].isnull) do inc(i);
> if i<fields.count then varvar:=fields[i].value;
> end;end;
>
-> varvar has the value of the first not null field, i holds the field number.
Correct?

> procedure tmainfo.afterendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> var j:integer;
> begin
> if akind = fek_find then begin
> j:=0;
> if not(varisempty(varvar) ) then
> with sender do begin
> while  (j<indexlocal.count) and
> (fields[i].fieldname<>indexlocal[j].fields[0].fieldname) do inc(j);

j is the index of the first localindex where the first indexfield is the first
not null filter field.

> if  (
> j< indexlocal.count ) and
>     (not indexlocal[j].findvariant([varvar],false,true)) then
>      showmessage('*** not found ***');
> end; end; end;

What is the problem? "findvariant([varvar],false,true)" works for me as
expected. Do you have local indices for all needed fields?

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza
Try to do a filter and  after that  a  find a value outside the fitler.   

De : Martin Schreiber <[hidden email]>
Envoyé : mardi 18 septembre 2018 16:06
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui
 
On Tuesday 18 September 2018 11:47:18 mohamed hamza wrote:
> The problem is  on findvariant and when the field to search is not a
> string.
>
> Here what I did.
>
> VarVar is a variant;
>
> procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> begin
> i:=0;
> with sender do begin
> while (i<fields.count) and (fields[i].isnull) do inc(i);
> if i<fields.count then varvar:=fields[i].value;
> end;end;
>
-> varvar has the value of the first not null field, i holds the field number.
Correct?

> procedure tmainfo.afterendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> var j:integer;
> begin
> if akind = fek_find then begin
> j:=0;
> if not(varisempty(varvar) ) then
> with sender do begin
> while  (j<indexlocal.count) and
> (fields[i].fieldname<>indexlocal[j].fields[0].fieldname) do inc(j);

j is the index of the first localindex where the first indexfield is the first
not null filter field.

> if  (
> j< indexlocal.count ) and
>     (not indexlocal[j].findvariant([varvar],false,true)) then
>      showmessage('*** not found ***');
> end; end; end;

What is the problem? "findvariant([varvar],false,true)" works for me as
expected. Do you have local indices for all needed fields?

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza
In reply to this post by mse
Try to do a filter  and then  find a value outside the filter.  ( using navigator)

Ex 
    values = ( 10,20,30,40)
set filter to value > 20   values  = ( 30,40)  are  listed 
try find 20    20 is listed  and the filter is off

Sample example is in mseuniverse/samples/db/dbfilterI .  I will not want to order you 
or ask you for an immediate response.

Best Regards.

Med.

De : Martin Schreiber <[hidden email]>
Envoyé : mardi 18 septembre 2018 16:06
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui
 
On Tuesday 18 September 2018 11:47:18 mohamed hamza wrote:
> The problem is  on findvariant and when the field to search is not a
> string.
>
> Here what I did.
>
> VarVar is a variant;
>
> procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> begin
> i:=0;
> with sender do begin
> while (i<fields.count) and (fields[i].isnull) do inc(i);
> if i<fields.count then varvar:=fields[i].value;
> end;end;
>
-> varvar has the value of the first not null field, i holds the field number.
Correct?

> procedure tmainfo.afterendfilteredit(const sender: tmsebufdataset;
>                const akind: filtereditkindty);
> var j:integer;
> begin
> if akind = fek_find then begin
> j:=0;
> if not(varisempty(varvar) ) then
> with sender do begin
> while  (j<indexlocal.count) and
> (fields[i].fieldname<>indexlocal[j].fields[0].fieldname) do inc(j);

j is the index of the first localindex where the first indexfield is the first
not null filter field.

> if  (
> j< indexlocal.count ) and
>     (not indexlocal[j].findvariant([varvar],false,true)) then
>      showmessage('*** not found ***');
> end; end; end;

What is the problem? "findvariant([varvar],false,true)" works for me as
expected. Do you have local indices for all needed fields?

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
On Tuesday 18 September 2018 20:06:46 mohamed hamza wrote:
> Try to do a filter  and then  find a value outside the filter.  ( using
> navigator)
>
> Ex
>     values = ( 10,20,30,40)
> set filter to value > 20   values  = ( 30,40)  are  listed
> try find 20    20 is listed  and the filter is off
>
You expect that tdataset.onfilterrecord is called in a tlocalindex.find()
call? It is not called currently. Probably not easy to achieve without
performance loss. I'll take a look.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
On 9/19/18 6:13 AM, Martin Schreiber wrote:

> You expect that tdataset.onfilterrecord is called in a tlocalindex.find()
> call? It is not called currently. Probably not easy to achieve without
> performance loss. I'll take a look.
>
Done, git master 5c75b84b5c543fff18e9fdef79f1b2c88886cc50, experimental.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza
I think we have to go back to the last MSEIDE. I am still debugging  mseuniverse/sample/db/dbfilter.prj. I do not know why the filter is reset each time  we do a filter and then a find ?

Excuse the inconvenience.

BEST REGARDS

Med

De : Martin Schreiber <[hidden email]>
Envoyé : mercredi 19 septembre 2018 14:19
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui
 
On 9/19/18 6:13 AM, Martin Schreiber wrote:

> You expect that tdataset.onfilterrecord is called in a tlocalindex.find()
> call? It is not called currently. Probably not easy to achieve without
> performance loss. I'll take a look.
>
Done, git master 5c75b84b5c543fff18e9fdef79f1b2c88886cc50, experimental.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
On Wednesday 19 September 2018 19:42:02 mohamed hamza wrote:
> I think we have to go back to the last MSEIDE. I am still debugging
> mseuniverse/sample/db/dbfilter.prj. I do not know why the filter is reset
> each time  we do a filter and then a find ?
>
Because the fek_find also calls the filter edit events and there is a
single "i" and "varvar" for all filter edit actions.

"
procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;
               const akind: filtereditkindty);
begin
i:=0;
with sender do begin
while (i<fields.count) and (fields[i].isnull) do inc(i); <<<--- sets i to the
currently edited field.

if i<fields.count then varvar:=fields[i].value; <<<--- sets varvar to the
currently edited value.

end;end;
"
"
procedure tmainfo.OnfilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
with dataset.fields[i] do <<<--- the field[i] is checked, i is the last
filteredited field.

case datatype of
ftdate,ftinteger,ftfloat,ftboolean,ftcurrency,ftsmallint,ftbcd:
case tmseBufDataset(dataset).FilterEditKind of <<<--- this is the last used
filtereditkind, it could be fek_find which is not in below case

fek_filtermin: accept:=value<varvar; <<<<--- varvar is the last used filter
edit value, it could be the find value.

fek_filter: accept:=value=varvar;
fek_filtermax: accept:=value>varvar;
end;
ftstring:
case tmseBufDataset(dataset).FilterEditKind of
fek_filtermin: accept:= msecomparetextlen(varvar,value)<0;
fek_filter: accept:=  msecomparetextlen(varvar,value)=0;
fek_filtermax: accept:= msecomparetextlen(varvar,value)>0;
end;
else showmessage ('Unsupported  ft*');
end;end;
"
An example is here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/db/dbfilter2
needs current git master.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza
Many thanks for your advice.
Is your algorithm valid regardless the number of fields in dataset ?

Regards.

NB: the  demo dbfiter2 has an exception  error ?
 

De : Martin Schreiber <[hidden email]>
Envoyé : jeudi 20 septembre 2018 12:50
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui
 
On Wednesday 19 September 2018 19:42:02 mohamed hamza wrote:
> I think we have to go back to the last MSEIDE. I am still debugging
> mseuniverse/sample/db/dbfilter.prj. I do not know why the filter is reset
> each time  we do a filter and then a find ?
>
Because the fek_find also calls the filter edit events and there is a
single "i" and "varvar" for all filter edit actions.

"
procedure tmainfo.beforeendfilteredit(const sender: tmsebufdataset;
               const akind: filtereditkindty);
begin
i:=0;
with sender do begin
while (i<fields.count) and (fields[i].isnull) do inc(i); <<<--- sets i to the
currently edited field.

if i<fields.count then varvar:=fields[i].value; <<<--- sets varvar to the
currently edited value.

end;end;
"
"
procedure tmainfo.OnfilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
with dataset.fields[i] do <<<--- the field[i] is checked, i is the last
filteredited field.

case datatype of
ftdate,ftinteger,ftfloat,ftboolean,ftcurrency,ftsmallint,ftbcd:
case tmseBufDataset(dataset).FilterEditKind of <<<--- this is the last used
filtereditkind, it could be fek_find which is not in below case

fek_filtermin:          accept:=value<varvar; <<<<--- varvar is the last used filter
edit value, it could be the find value.

fek_filter:                             accept:=value=varvar;
fek_filtermax:  accept:=value>varvar;
end;
ftstring:
case tmseBufDataset(dataset).FilterEditKind of
fek_filtermin:          accept:=         msecomparetextlen(varvar,value)<0;
fek_filter:                             accept:=  msecomparetextlen(varvar,value)=0;
fek_filtermax:  accept:=        msecomparetextlen(varvar,value)>0;
end;
else showmessage ('Unsupported  ft*');
end;end;
"
An example is here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/db/dbfilter2
needs current git master.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
On 9/21/18 12:52 PM, mohamed hamza wrote:
> Many thanks for your advice.
> Is your algorithm valid regardless the number of fields in dataset ?
>
Yes.

> NB: the  demo dbfiter2 has an exception  error ?
>
Which one? Works for me.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mse
Administrator
In reply to this post by mohamed hamza
On 9/21/18 12:52 PM, mohamed hamza wrote:
>
> NB: the  demo dbfiter2 has an exception  error ?
>
Please try again with git master
6238275e6d12c864a32ecec68b95c8c3432a2143, there was an invalid db file.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui

mohamed hamza
In reply to this post by mse
I have an exception : Stream read Error  

I can not open dataset.

By  algorithm I am referring to procedure tmainfo.filterchangedev(const sender: tmsebufdataset) is it universal or depending on  number of fields in  dataset?;

Regards.

Nb:
I want to change the object of all messages uploaded to mseide-msegui-talk under this subject  ( General List .........)
to  the subject Filter-find like this the user can easily find them. How to proceed with the moderator ? 
 
Objet : Re: [MSEide-MSEgui-talk] General list for MSEide+MSEgui
 
On 9/21/18 12:52 PM, mohamed hamza wrote:
> Many thanks for your advice.
> Is your algorithm valid regardless the number of fields in dataset ?
>
Yes.

> NB: the  demo dbfiter2 has an exception  error ?
>
Which one? Works for me.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mse
Administrator
On 9/21/18 1:36 PM, mohamed hamza wrote:
> I have an exception : Stream read Error
>
> I can not open dataset.
>
> By  algorithm I am referring to procedure tmainfo.filterchangedev(const sender: tmsebufdataset) is it universal or depending on  number of fields in  dataset?;
>
tmainfo.filterchangedev() is used in example in order to show the filter
values in the grid headers. In your own code you probably don't need it.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mse
Administrator
On 9/21/18 2:03 PM, Martin Schreiber wrote:
> On 9/21/18 1:36 PM, mohamed hamza wrote:
>> I have an exception : Stream read Error
>>
>> I can not open dataset.
>>
Should be fixed in 6238275e6d12c864a32ecec68b95c8c3432a2143.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mohamed hamza
In reply to this post by mse
did you commit last mseuniverse archive ? I  have the same error with archive dating 20 ? ( I have seen Gitlab with 2 archives  with the  same date 20)  

regards

De : Martin Schreiber <[hidden email]>
Envoyé : vendredi 21 septembre 2018 12:03
À : [hidden email]
Objet : [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)
 
On 9/21/18 1:36 PM, mohamed hamza wrote:
> I have an exception : Stream read Error
>
> I can not open dataset.
>
> By  algorithm I am referring to procedure tmainfo.filterchangedev(const sender: tmsebufdataset) is it universal or depending on  number of fields in  dataset?;
>
tmainfo.filterchangedev() is used in example in order to show the filter
values in the grid headers. In your own code you probably don't need it.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mse
Administrator
On 9/21/18 11:01 PM, mohamed hamza wrote:
> did you commit last mseuniverse archive ? I  have the same error with archive dating 20 ? ( I have seen Gitlab with 2 archives  with the  same date 20)
>
Forgotten, sorry. Should be there now.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mohamed hamza
All it's Ok. But when I tried  to  connect  to a  firebird server  ( bdo_local off )  it is an  other result did  you try it ?  

Med  

De : Martin Schreiber <[hidden email]>
Envoyé : samedi 22 septembre 2018 06:16
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)
 
On 9/21/18 11:01 PM, mohamed hamza wrote:
> did you commit last mseuniverse archive ? I  have the same error with archive dating 20 ? ( I have seen Gitlab with 2 archives  with the  same date 20)
>
Forgotten, sorry. Should be there now.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mse
Administrator
On 9/22/18 8:28 PM, mohamed hamza wrote:
> All it's Ok. But when I tried  to  connect  to a  firebird server  ( bdo_local off )  it is an  other result did  you try it ?
>
No, what happens?

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mse
Administrator
In reply to this post by mohamed hamza
On 9/22/18 8:28 PM, mohamed hamza wrote:
> All it's Ok. But when I tried  to  connect  to a  firebird server  ( bdo_local off )  it is an  other result did  you try it ?
>
Works for me.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)

mohamed hamza
 Did you try to find with a field which has not a local index?
 
Med 

De : Martin Schreiber <[hidden email]>
Envoyé : dimanche 23 septembre 2018 06:44
À : [hidden email]
Objet : Re: [MSEide-MSEgui-talk] dbfilter2 demo (was: General list for MSEide+MSEgui)
 
On 9/22/18 8:28 PM, mohamed hamza wrote:
> All it's Ok. But when I tried  to  connect  to a  firebird server  ( bdo_local off )  it is an  other result did  you try it ?
>
Works for me.

Martin


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
123