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 <[email protected]> Envoyé : jeudi 20 septembre 2018 12:50 À : [email protected] 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 [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
_______________________________________________ mseide-msegui-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

