wildcards problem in filter. lazarus / 16-Databases ---------------------------------------------------------------------- Roger king · 2011-03-12 22:24 Hello. When using TDBF in Delphi 4 I can use a filter: status = 'club', or status = '*lub' or Status = 'Cl*', or Status = '*lu*'. In each case all records containing 'club' in the Status column are found. When using TDBF in Lazarus, 0.9.28. beta the '*' is ignored in every case and the filter fails. Also, in Delphi 4 I can view all records in the DBGrid, using the scroll bars and test the filter, during design time. In Lazarus I can't. Is this normal? Regards Roger ---------------------------------------------------------------------- marcov · 2011-03-13 11:40 While I don't know a direct answer, please try a recent snapshot first. TDBF and the database layer have had two years of patching after the (I think) 2.2.4 that comes with 0.9.28 ---------------------------------------------------------------------- Roger king · 2011-03-13 13:17 Hi Marcov. Thanks for your reply. I am familliar with Delphi 4 but new to Lazarus so can you explain what a new snapshot means. Do I have to download and install the latest release of Lazarus or just the patches. If the answer is the patches where do I find them and how do I apply them? Further investigation shows that: status = 'cl*' does find records starting with 'cl', but adding a * before 'lu*' fails. Regards Roger ---------------------------------------------------------------------- Leledumbo · 2011-03-13 17:10 QuoteI am familliar with Delphi 4 but new to Lazarus so can you explain what a new snapshot means. Do I have to download and install the latest release of Lazarus or just the patches. If the answer is the patches where do I find them and how do I apply them?Snapshot means the 'bleeding edge' version, i.e. the currently being developed. Daily snapshots (as you see in the left panel of this page) shows the very latest update of the development (that is, today or last night version). Both source and compiled version are available AFAIK, take whichever you want. No standalone patch that you have to apply manually though. ---------------------------------------------------------------------- Avishai · 2011-03-13 17:16 Wouldn't "lu*" find what you are looking for without the "*" (*lu*)prefix?  I would think it would find "club, Clue, blue..." as well. ---------------------------------------------------------------------- Roger king · 2011-03-13 19:33 Hi, Avishai. Yes, you are correct but this is a simple example. In the real world I want to find a string inside a longer sentence. For example I might want to locate all records containing hydraulic valves in a field containing a list of items in a purchase order database. There is no cetainty that they will be the first item in the list, so these records won't be found. That is why wildcards should work at the front and end. TDBF does this in Delphi, so it is obviously possible. Maybe I could substitute the dbf.pas file from Delphi but I don't know if this would work. Thanks for your assistance. Roger ---------------------------------------------------------------------- Avishai · 2011-03-13 19:44 I knew there had to be more to it than what I was understanding.  I wish I could have been more helpful.  Maybe a TStringList and scan the individual word?  I'm only thinking "out loud".  I doubt it's much help.  Good Luck. ---------------------------------------------------------------------- Roger king · 2011-03-20 20:50 Hello Leledumbo. I looked at Snapshots. When I read the warning: If they destroy your project files, crash your machine, and eat your disk: Tough luck! (just to say that YOU ARE USING COMPLETELY UNTESTED SOFTWARE). I didn't think the risk was worth it. Does anybody agree that the problem I am reporting exists or is this just my problem? Thanks. Roger King ---------------------------------------------------------------------- Leledumbo · 2011-03-21 15:47 QuoteI didn't think the risk was worth it.The statement is true, but the fact is many of us uses it and it seldom have such mentioned problems (project files destroyed? machine crashed? nope, never had it). The last statement is the point, but after all, if no one uses it, then no one will know whether a bug exists or not that leads to unreported problems. Relax, trust me, it's just as stable as the stable release (in fact, many problems here are fixed by using the latest snapshot). ---------------------------------------------------------------------- Roger king · 2011-03-27 11:04 Hello Leledumbo. I downloaded Lazarus snapshot + fpc 2.4.2, now Lazarus doesn't work at all. My database program said it couldn't find Lazdb, so I gave up on that and started a new project. I can't remember the exact sequence that followed. At one stage I got the message that the new version couldn't work with FPC 2.2, so I found that and deleted it leaving only version 2.4. In my Lazarus directory the files I downloaded today are: is-MGTDB.tmp startlazarus.exe lazbuild.exe lazarus.exe I have run the 3 .exe files without any success. I started a new project, just a blank file. The code is: program Project1; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Interfaces, // this includes the LCL widgetset   Forms, Unit1   { you can add units after this }; {$R *.res} begin   Application.Initialize;   Application.CreateForm(TForm1, Form1);   Application.Run; end. Trying to run it brought up the message: "C:\DOCUME~1\Roger\LOCALS~1\Temp\project1.lpr(1,1) Fatal: Can't find unit Interfaces used by Project1" I have corrected the file path in Environment for FPC2.4. Any idea what is wrong? Regards Roger ---------------------------------------------------------------------- vvzh · 2011-03-27 14:13 From the above description it is hard to understand how you installed Lazarus. Maybe the reason for all these errors is mixing files from different Lazarus/FPC versions. To get rid of all errors at once I would suggest to do a clean reinstall. 1. Remove all FPC's and Lazarus'es you installed using their uninstallers. 2. Backup and remove remaining directory ("C:\Lazarus" or whatever you installed Lazarus to). 3. Backup and remove lazarus settings ("C:\Documents and Settings\Roger\Local Settings\Application Data\lazarus" directory). 4. Remove all Lazarus/FPC-related directories from PATH (i.e. those starting with "C:\Lazarus" or whatever you installed Lazarus to) 5. Download a snapshot. I would suggest using "Lazarus fixes + fpc 2.4.2" from this page. Since it is going to be a release version (0.9.30) soon, it is probably more stable than development version (0.9.31). 6. Install downloaded snapshot to directory without spaces and non- latin letters in path, e.g. "C:\Lazarus". ---------------------------------------------------------------------- Roger king · 2011-03-27 18:40 Thanks for your reply vvzh. I did download "Lazarus fixes + fpc 2.4.2". I got the file "Lazarus-0.9.29-29679-fpc-2.4.2-20110227-win32.exe",  which I ran. When I look in my Lazarus directory most of the previous files and directories have been overwritten with yesterday's date. The only directories not updated where lazarus.app, mingw and units. Checking showed that the exe.files in the lazarus directory, which I said I ran, were dated 27/02/2011, the date of the release. Does this make any sense to you? Regards Roger ---------------------------------------------------------------------- Roger king · 2011-03-27 19:29 Well. I deleted everything and ran Lazarus-0.9.29-29679-fpc-2.4.2-20110227-win32.exe again. Now Lazarus works, but guess what? Filters still don't work if I try to find a string inside the field. Also I tried the Linux version, in Mint8. This has the same problem. So, I'm back to the start. Tbdf works in the Delphi version, so why can't the free pascal version do it? Can I use the equivalent Delphi .pas files in lazarus? I asked the same question on the Sourceforge.net 'tDBF component for Delphi and BCB' forum on the 18th of march. So far I have had zero replies. ---------------------------------------------------------------------- krzynio · 2014-02-03 21:52 Hi! Any progress in this bug? I have the same problem with asterisk at beginning of text and with more than one asterisk. The problem exists at least on Lazarus with Zeoslib stable 7.1.2 and older and on Lazarus versions from 0.9.3 to 1.3 (TRUNK). It occurs on Firebird and on sqlite (did not try another databases).  It looks very easy to solve but remains still not solved? Best regards, Krzysztof