Jump to content

Mike Torrettinni

  • Content Count

  • Joined

  • Last visited

  • Days Won


Mike Torrettinni last won the day on July 9

Mike Torrettinni had the most liked content!

Community Reputation

130 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mike Torrettinni

    GExperts Grep Search

    True, but I'm not trying to put pressure on Thomas so I'm only asking what is possible right now and if I'm missing something really obvious like I did with option Parse map file.
  2. Mike Torrettinni

    GExperts Grep Search

    I can only enable this option if I search Directories and not files. Do you know if this option (Exclude dirs) can be enabled and applied to search All files in project/All files in project?
  3. Mike Torrettinni

    GExperts Grep Search

    Aha, it works only on project files if I temporarily rename rtl source folder, to source_.
  4. Mike Torrettinni

    GExperts Grep Search

    Yes, I do have Map file as detailed in Linking option, and it works when I choose Parse map file, thanks! But now I get also RTL and other (Indy...) .pas files in search results, when searching for something that I guess appears in these source files, too. What setting could it be that doesn't include Delphi's source files?
  5. Mike Torrettinni

    GExperts Grep Search

    Do you know how it can search through units that are not defined (used) in .dpr, but are used in the project? If I select All files in project it doesn't search in units not defined in .dpr.
  6. Mike Torrettinni

    Parsing Text search expression

    I think I could instruct to use double-quotes for or/and and other operators, like it's used for phrases: "or customer" or "and customer" or "or" or "and" ....
  7. Mike Torrettinni

    Parsing Text search expression

    Yes, I think you are right. Probably I can make it work with a lot of modification to fit within case like this: I think this would require quite a modification of expression from: 'john or peter' to 'user = john or user = peter'. I assume to actually replace Pos(), would need to use LIKE (or CHARINDEX) SE.ParseString('user LIKE ''%john%'' or user LIKE ''%peter%''');
  8. Mike Torrettinni

    Parsing Text search expression

    User input search string, yes like google. I mean simple edit box. No nested levels at this point. Thanks for suggestions!
  9. Mike Torrettinni

    Parsing Text search expression

    Yes, it's very powerful component, shame it can't parse expressions that are not pure SQL. I could probably customize my expression to add 'SELECT' and other sql keywords to parse, but that is not what I'm after.
  10. Mike Torrettinni

    Parsing Text search expression

    It's triggered on user input, so no need for super fast. I do have 'instant search' (search as you type), but this is not applicable for complex cases or if you type really fast, I guess under 1s should be just fine. Oh, I do have highlighting of text for visual representation, but that only works on a found results, so doesn't need to be super fast, either. Thanks, you gave me a lot to think about!
  11. Mike Torrettinni

    Parsing Text search expression

    Thank you @Kas Ob., yes SQL is not on the table.. unless all other options are too complex to implement, but I doubt it. I was thinking similar thing as you to parse expression and build some logical expression out of it and then run on text. But my idea was (just an idea so far) to run a full logical expression on each string, while your suggestion is to create lists based on parts of expression and then combine/cross-sect lists as operators say, right? So, my idea was to parse expression to end up with something like: this is as stage 3) in your example function EvalPhraseInText(const aText: string): boolean; begin Result := ((Pos('text_phrase', aText)>0) OR (Pos('testing', aText) > 0 ))// replace AND Pos('text', aString) > 0 OR (Pos('anything else', aString)> 0; end; of course, I have no idea how to get to this point, at the moment, as this would be point 2) build logic flow. I assume you thought of this approach when you were working on your solution and decided that is not as good as your solution.
  12. I have a very simple text search feature that uses Pos() to locate search text in string. Now I want to extend it to handle just a little more complex phrases. I think the most complex examples I need to implement includes: - brackets - quotes for full phrase - and AND/OR Probably most complex example: ("test phrase" OR testing) AND text OR "anything else" I assume most common will be simple examples like: test OR test2 test OR "test case" test AND test2 I have all text in arrays with object IDs to know where it belongs, records like: CustomerID, Address, Name, Notes; DocID, Title, Description, Notes... - and all fields except CustomerID, DocID are searchable strings. One idea is to try to convert search expression into regex, the other one if to parse the expression and try to make logical search as needed (this would probably be most complex to implement). I see examples of using database and use their advanced search capabilities like: https://zarko-gajic.iz.hr/full-text-search-functionality-in-delphi-applications-implementation-idea/ But this is just one small feature of my full project, so I'm not really sure I want this to be reason to implement database, even the lightest ones. I appreciate any suggestions on parsing such expression, converting to regex.. perhaps there are components that already do same or similar things.
  13. Thanks. Nice, very good to see this progress!
  14. If anybody wants to test GetEnumName vs other tests, this is Run4 I added to the original tests: uses System.TypInfo; procedure Run4; var i, j: integer; vStr: string; begin for i := 1 to cLoop do for j := 0 to Pred(cNoOfEnums) do begin vStr := ''; vStr := GetEnumName(TypeInfo(TEnum), j); end; end; ... vSW := TStopWatch.StartNew; Run4; vSW.Stop; Writeln('GetEnumName: ' + vSW.ElapsedMilliseconds.ToString); Perhaps anybody with 10.3 or 10.4 will see improvement in RTTI, versus my 10.2.3 version.
  15. I just added Edit to my first post. I hope it gives more context on the purpose of this topic.