Jump to content

FredS

Members
  • Content Count

    399
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by FredS

  1. FredS

    Issue with IDE Nav Bar..

    No, I was going to add what you posted to test but since I use MMX I hardly use that Nav Bar. In a large unit it already failed without in-line variables..
  2. FredS

    Issue with IDE Nav Bar..

    You know MMX is free now thanks to Uwe: https://www.mmx-delphi.de/ I was going to see if I could duplicate your issue but the Nav Bar thing won't even show all helpers/classes in my file never mind testing that..
  3. FredS

    IDE Fix pack for Rio

    A little early to be sure but it appears to have solved my painting problem: Thanks Emba.. err.. Andy..
  4. FredS

    TurboPack OnGuard for Rio 10.3.1?

    By that you mean the same code but it clobbers any previous version and doesn't install correctly? 'Getit' is a form of 'torture', if I could get 'CodeSite' without it I would never run that thing..
  5. FredS

    TurboPack OnGuard for Rio 10.3.1?

    Might be easier just to use the one on GitHub it compiles in Rio.
  6. Yes and best readability. That said I've moved all to Attributes now: [EnumNames('TestEnumAttribute', 'Hello, World')] TTestEnumeration = (First, Second); and to retrieve it: Enum<TTestEnumeration>.EnumName('TestEnumAttribute', TTestEnumeration.First) --> 'Hello' Usually I document where I find this stuff but that seems to have gone missing a quick search didn't bring up any of that but this instead: https://gist.github.com/ortuagustin/6342894207caa0f71a5d23475670281d It sure saves writing a matrix for each Enum you need in human readable form.
  7. FredS

    IDE Fix pack for Rio

    From: https://andy.jgknet.de/blog/ide-tools/ide-fix-pack/ fastdcc There are 2 ways to use fastdcc. 1. Using fastdcc directly Extract the 7z file into your $(BDS)\bin directory. Start fastdcc32.exe as if it was dcc32.exe Start fastdcc64.exe as if it was dcc64.exe Start fastdccaarm.exe as if it was dccaarm.exe 1. Replacing dcc32.exe by fastdcc32.exe (don’t do this if you want to be able to install future RAD Studio/Delphi/C++Builder updates) Extract the 7z file into your $(BDS)\bin directory. Rename dcc32.exe, dcc32.jdbg and dcc32.de/fr/jp to dcc32compiler.exe/jdbg/de/fr/jp. Rename dcc64.exe, dcc64.jdbg and dcc64.de/fr/jp to dcc64compiler.exe/jdbg/de/fr/jp. Rename fastdcc32.exe to dcc32.exe Rename fastdcc64.exe to dcc64.exe Rename fastdcc32Hook.dll to dcc32Hook.dll For XE3 or newer: Rename fastdcc32Hook.dllx to dcc32Hook.dllx (“x” is necessary for Delphi’s copy protection) Rename fastdcc64Hook.dll to dcc64Hook.dll For XE3 or newer: Rename fastdcc64Hook.dllx to dcc64Hook.dllx Start dcc32.exe/dcc64.exe or msbuild.
  8. FredS

    (Mis-)Behaviour of TStringHelper

    LastIndex and DownRange would help but honestly, this is like having to flip your steering wheel when you shift the car into reverse. 🙂
  9. FredS

    (Mis-)Behaviour of TStringHelper

    Yeah, certainly made clear in the documentation </sarcasm> One would hope that when they copied a DotNet function they could at least copy the DotNet explanation: The search starts at a specified character position and proceeds backward toward the beginning of the string for the specified number of character positions. At this point the claim that it works as expected needs to come with new documentation.
  10. FredS

    (Mis-)Behaviour of TStringHelper

    True but it is the same as IndexOf, should I now file a bug report for IndexOf? StartIndex specifies the initial offset in this 0-based string where the search starts Because this does not compute: Assert(s.IndexOf('Hello', 38) = s.LastIndexOf('Hello', 38)); I originally looked at the source and also took " startIndex - (Length(searchText) - 1)" into account but here is that math: // 0 19 38 0-based s := 'Hello how are you, Hello how are you, Hello how are you'; // ^ 32 Startindex - (Length('Hello')- 1), searched forward or backward? IMO at this point the claim that it works as expected needs to come with new documentation or a bug fix.
  11. FredS

    How to fix missing packages

    From: stackoverflow Close the IDE, then delete the <whatnot> folder from $(BDSCatalogRepository) After that, you have to edit the registry and delete also the <whatnot> folder from: HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\<ProductVersion>.0\CatalogRepository\Elements
  12. FredS

    (Mis-)Behaviour of TStringHelper

    I moved on in 2016, so what happens with this method is no longer for me only for those who spend hours searching for bugs they can't figure out. And I'm not looking for the 'First occurrence', that would be 'IndexOf', so either way the function fails. Returns the last index of the Value string in the current 0-based string. StartIndex specifies the offset in this 0-based string where the LastIndexOf method begins the search, and Count specifies the end offset where the search ends. There are six LastIndexOf overloaded methods, each one allowing you to specify various options in order to obtain the last index of the given string in this 0-based string. When the Value argument (Char or String), passed to LastIndexOf, is not found in the 0-based string, LastIndexOf function returns -1.
  13. FredS

    (Mis-)Behaviour of TStringHelper

    I didn't want to hijack this thread for something I moved on from years ago, so really quickly: Berlin Help: Returns the last index of the Value string in the current 0-based string. { TStringHelper.LastIndexOf returns wrong values } // 0 19 38 0-based s := 'Hello how are you, Hello how are you, Hello how are you'; Assert(s.IndexOf('Hello', 38) = s.LastIndexOf('Hello', 38)); As for the "Huh?" next to LastDelimiter, that was me not understanding how that worked.
  14. Essentially all system wide methods are run through DUnitX now. This is how I know that RSP-15040 is still in Rio 10.3.1, I use that when anyone asks why I built my own string helper. Depending on complexity I use TestInsight while coding.
  15. FredS

    Error insight in Rio

    You can answer your own question by looking at the age of some of those reports in QP..
  16. FredS

    How to replace whole words in a string

    Then you need to figure out what that logic is, it's not word boundaries: https://regex101.com/r/bnXElq/1
  17. FredS

    How to replace whole words in a string

    The code below will return: 'yes, yes.def' v := TRegEx.Replace('abc, abc.def', '\babc\b', 'yes', [TRegExOption.roIgnoreCase]); \babc\b Options: Case insensitive; Exact spacing; Dot doesn’t match line breaks; ^$ match at line breaks; Numbered capture; Skip zero-length matches Assert position at a word boundary (position preceded or followed—but not both—by an ASCII letter, digit, or underscore) «\b» Match the character string “abc” literally (case insensitive) «abc» Assert position at a word boundary (position preceded or followed—but not both—by an ASCII letter, digit, or underscore) «\b» Created with RegexBuddy
  18. FredS

    10.3.1 has been released

    Wasn't there in 10.3, so new to me with 10.3.1.
  19. FredS

    10.3.1 has been released

    Yup.
  20. FredS

    10.3.1 has been released

    First impressions count.
  21. This was about Record class destructors.
  22. Oh boy.. It can't in MMX up to14.0.5 🙂
  23. Why?  To use the Class Destructor for cleanup.
  24. For this I would simply use a Class Helper to separate the UI logic.
  25. Fine for Global vars as long as you don't need to finalize. At that point just change to a class. Pretty sure you don't actually want Global Instance data.. more like a snack without the preparation and cleanup 🙂 //MMWIN:CLASSCOPY unit _MM_Copy_Buffer_; interface type TGlobal = record class var Id : Integer; RecName : string; Values : TArray<TValue>; class constructor Create; private class function GetNewProperty: Integer; static; class procedure SetNewProperty(const Value: Integer); static; public class property NewProperty: Integer read GetNewProperty write SetNewProperty; end; implementation class constructor TGlobal.Create; begin inherited; // TODO -cMM: TGlobal.Create default body inserted end; class function TGlobal.GetNewProperty: Integer; begin // TODO -cMM: TGlobal.GetNewProperty default body inserted Result := ; end; class procedure TGlobal.SetNewProperty(const Value: Integer); begin // TODO -cMM: TGlobal.SetNewProperty default body inserted end; end.
×