BufDataset | filter with and/or lazarus / 16-Databases ---------------------------------------------------------------------- cpalx · 2018-11-03 20:50 hello, how could i do something like this? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i with bufdataset1 do begin   filtered:= false;   filter:= format(  'field1= ''%s''  or field2= ''%s:0'' ', [edit1.text] );   filtered:=true;end; ---------------------------------------------------------------------- lucamar · 2018-11-03 20:56 I don't know the answer but about the Format ... shouldn't it be like this: Format( 'field1= ''%s''  or field2= ''%s:0'' ', [edit1.text] ); ??? ---------------------------------------------------------------------- cpalx · 2018-11-03 21:02 @lucamar you are right about the format. I will edit my post. the problem goes on ---------------------------------------------------------------------- wp · 2018-11-03 21:05 There are two format parameters in the format string, but there is only one string. Either you apply a second parameter Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Format('field1= ''%s'' or field2=''%s''', [Edit1.Text, Edit2.Text]);or if there is only one parameter needed twice you can use an index in the format string as proposed by lucamar; but use the correct syntax: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Format('field1= ''%0:s'' or field2=''%0:s''', [Edit1.Text]);See: https://www.freepascal.org/docs-html/rtl/sysutils/format.html ---------------------------------------------------------------------- lucamar · 2018-11-03 21:36 Quote from: wp on November 03, 2018, 10:05:28 pm[...] but use the correct syntax: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Format('field1= ''%0:s'' or field2=''%0:s''', [Edit1.Text]); Oops! Sorry, I did, indeed, invert the expression. I never remember all the nuances of Format Re. the expression itself, I have been looking into the sources and found that the filter is parsed in unit dbf_prscore. Its header apparently points to some info: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit dbf_pr score; {-------------------------------------------------------------- | TCustomExpressionParser|| - contains core expression parser|| This code is based on code from:|| Original author: Egbert van Nes| With contributions of: John Bultena and Ralf Junker| Homepage: http://www.slm.wau.nl/wkao/parseexpr.html|| see also: http://www.datalog.ro/delphi/parser.html|   (Renate Schaaf (schaaf at math.usu.edu), 1993|    Alin Flaider (aflaidar at datalog.ro), 1996|  Version 9-10: Stefan Hoffmeister, 1996-1997)||----------------------- ----------------------------------------} interface  [. . .]