Jump to content

dummzeuch

Members
  • Content Count

    2637
  • Joined

  • Last visited

  • Days Won

    91

Everything posted by dummzeuch

  1. I'm assuming with "Delphi Windows application" you mean the IDE: Create a batch file that adds to the path, and then starts the IDE (and exits so the console window closes). If you don't want a batch file (many people complain about the "ugly console window"): Write a program that creates a new environment variable block and pass that when executing the IDE.
  2. dummzeuch

    Function with just underscore _() seems to be valid

    We have Delphi, we don't need no fchking brainf*ck or whitespace. x=3
  3. dummzeuch

    Delphi Closedown Error

    BTW: Yesterday I finally found and fixed a problem in GExperts which caused an access violation on IDE shutdown (an OTAPI interface reference that wasn't released after use). But it was caught and logged by an exception handler, so nobody using a release version of GExperts should have seen it. The fix was exactly one line of code, but it took me hours to track it down. The fun with working on IDE plugins: You can reproduce the problem, you see the call stack, you can even single step to the last line of your own code before it happens, but then you only get lots of assembler code of the IDE and other plugins which tells you nothing about what happens.
  4. dummzeuch

    Delphi Closedown Error

    There are many of those stories. I heard about a Novell (remember them?) server which had been used for years but the company had forgotten where it was located. It was eventually found after a decade of uptime, still working fine. I think that's simply an urban legend, but it might also have been a marketing story.
  5. dummzeuch

    Experience/opinions on FastMM5

    That's a common misconception: You will have to make the source code available to everybody you give the binary. So, of it's a commercial application, that means you must give your customers the source code of your application as well as the source code of every library you used. On top of that you cannot restrict how they use that source code, as long as they adhere to the GPL. But you don't need to make the source code publicly available.
  6. Another thing I just found out is that the Grep expert uses a regular expression for the exclude dirs option. It first escapes meta characters (e.g. '.', '*', '\' etc.), replaces ';' with '|' and then uses the result as a case insensitive regular expression to match the full directory name and the full file name. Every directory or file that matches the regex is excluded from the search. The help says this: Exclude Dirs: A semicolon separated list of directories to exclude from the search (the exclusion is done via a substring match on the full directory and file name) I always assumed that this filter is only applied to the name of subdirectories and that it does a full match, e.g. 'src' matches the 'src' subdirectory only, not just any directory name that contains the string 'src', e.g. 'deleted-src'. And I never expected it to match a file name like 'somesrc.pas'. Searching the directory 'd:\src\SomeProject' with an exclude dirs filter of 'src' will actually find nothing at all because all names will start with 'd:\src' which always matches the filter! Did you know that? Is this a bug or a feature?
  7. dummzeuch

    Regular expression for "exclude dirs" in Grep?

    OK, since nobody bothered to reply, I assume that it won't matter if I change that feature to do what most people will assume it does: Only search sub-directories that do not match those given in the exclude dirs list.
  8. dummzeuch

    Delphi Closedown Error

    I think that might be GExperts, in particular when using the GExperts code formatter. I have tried to find and fix this issue without any luck for many years.
  9. dummzeuch

    Windows Build 1909

    I updated to 1909 from Windows 8.1 in December 2019. There were two issues that I remember, but these do not concern any recent Delphi versions: Updating to Windows 10 broke Delphi 6 and 2007 again Installing dotNet 2.0 on Windows 10 (The second was not an update issue but installing Delphi 2007 on a fresh Windows 10 installation.) This is why I blog about those issues. I keep forgetting them if I don't.
  10. dummzeuch

    Does GExperts work in C++Builder

    Basically C++ Builder in later versions is RAD Studio with a reduced feature set, so in theory it should work. Some experts are restricted to Delphi code (which as far as I know can also be compiled with C++ Builder). Since I don't program in C++ with RAD Studio, I don't know whether there are any problems. I haven't gotten any feedback from C++ programmers on that either. But it is easy to remove GExperts from RAD Studio if it causes any problems: Delete the GExperts entry from Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\20.0\Experts and it is gone. So, it is fairly safe to just try it.
  11. dummzeuch

    Where did I come from

    When I see code like this I always wonder why the functions aren't called isBusy and isIdle rather than Busy and Idle. Prefixing them with "is" makes it clear that they will return a Boolean value.
  12. The IFDEF editor expert was added to GExperts in 2016 and improved again in the same year, to support symbols defined in include files. Unfortunately sometimes an include file itself sometimes includes other files (e.g. jclNN.inc in the JEDI Code Library includes jedi.inc) which will usually add additional symbols which are then available for conditional compilation. But the IFDEF expert only listed symbols from the original include file. This has irked me for a long time, ... (read on in the blog post)
  13. If it's only about blocking Google, why not simply post the password on the site itself?
  14. TJSONObject.Size was deprecated and replaced by .Count in Delphi XE6, so up to Delphi XE5 you have to use .Size (because .Count doesn't exist) and from Delphi XE6 on you either live with the deprecated warnings (.Size is still available in Delphi 10.3) or replace the calls with .Count. But even if you accept those warnings, sooner or later you will have to address them because Embarcadero decided to finally remove the deprecated code. So, what if you want your code to compile on all versions that support JSON without warnings? E.g. in my u_dzGoogleTranslate unit there is the following code: if o.Size <> 3 then raise Exception.CreateFmt(_('Parsing error on JSON answer: Root object size is %d not 3.'), [o.Size]); where o is a TJSONObject. This compiles fine in all Delphi versions that have JSON support but starts throwing deprecated warnings from Delphi XE6 on. So, what are my options? I could IFDEF all those calls: {$IFDEF JSONOBJ_HAS_COUNT} if o.Count <> 3 then raise Exception.CreateFmt(_('Parsing error on JSON answer: Root object size is %d not 3.'), [o.Count]); {$ELSE} if o.Size <> 3 then raise Exception.CreateFmt(_('Parsing error on JSON answer: Root object size is %d not 3.'), [o.Size]); {$ENDIF} Which would be fine for one single line, but there are dozens of similar lines which renders the code unreadable. I could IFDEF complete functions instead but that would mean to fix any bug in all these functions. I could add a class helper for TJSONObject that adds the missing Count function for earlier versions (I think they all support class helpers, so that would be doable.) I could derive TdzJSONObject from TJSONObject and add the missing Count function but that would not work for RTL code that returns a TJSONObject. I could write an inlined wrapper function JSONObject_size that encapsulates that IFDEF. That would improve readability but but would still be ugly. I could drop support for Delphi XE5 or earlier, but I'd rather not. You never know when you're going to need that. Can you think of any other options?
  15. OK, I should have provided some background: This library is a hobby project of mine, there are only a very limited number of people that use it: I myself at work my two coworkers (but only in Delphi 2007, XE2 and lately 10.2) I myself (again) in many of my open source projects that support various versions of Delphi (for GExperts that means Delphi 6 and later), but not all units from that library are important for this Even though this library has been open source (MPL) for at least 15 years, I have never heard of anybody else using it (Which I think is a shame, but hey, they just don't know what they are missing out. 😉 ) So, I don't want to drop compatibility if it can be kept without too much hassle, I'm asking for alternatives. Believe it or not: Maintaining backwards compatibility can be fun if it involves creative (mis-)uses of language features. I am programming in Delphi for fun, not just for the paycheck, otherwise I would have dropped Delphi for Visual Studio more than 10 years ago.
  16. dummzeuch

    Align right in Converts Strings

    Applied. Thanks again.
  17. I wrote my own TThread class descendant which sets the name to the class name. It also automatically sets the name "Main" for the main thread. (Don't the latest Delphi versions already do that?)
  18. While fixing some bugs in the code formatter I came across a functionality that I didn't know about: procedure bla; begin end; The formatter can insert a fixed comment above each procedure like this: { procedure } procdure bla; begin end; It does this only if the configuration option CommentFunction is set to True. It's False by default and there is no GUI way to set it, so I never noticed. I think the way it currently works is pretty pointless, especially since the comment is hard coded as '{ procedure }' and is inserted above each procedure, function constructor and destructor. Even if there is already a different comment: { This is a comment } procdure bla; begin end; becomes { This is a comment } { procedure } procdure bla; begin end; Nobody needs that. Would any other automatically created comment be more useful? I can't think of any, but maybe somebody else has an idea? Currently I'd rather remove that functionality. I don't think a code formatter should add comments, it should simply format the source code that is there.
  19. dummzeuch

    Delphi Licensing

    I have no idea what might cause this, but since support is unable to resolve this, I would expect them to issue a new license just in case there is something wrong with the old one on Embarcadero's side. Since there are two different computers involved on your side it is likely to be a problem on their side. Hm, thinking about it: Has anything changed regarding your internet access? Is it possible that Embarcadero's servers can no longer be contacted? Could you maybe try to move your laptop to a friend and try his internet access to make sure? An option for support to help you could also be to convert your license to a Network Named User license. That would require you to run your own license server, but could prevent anything like this happening again.
  20. That's actually one change I made over Easter: The Formatter does no longer insert a blank line between a comment and the procedure it describes. Are there any other experts in GExperts that do this?
  21. dummzeuch

    Align right in Converts Strings

    Create a diff of all changed files (TortoiseSVN can do that, see TortoiesSVN -> Create Patch) and send it to me via private message or upload it as an attachment to a feature request on sourceforge.
  22. dummzeuch

    Align right in Converts Strings

    Might be a nice addition. Care to submit a patch?
  23. The base Exception class introduces various constructors. If you use ressources strings, there are two options: raise Exception.CreateFmt(MY_RES_STRING, [parameters, go, here]); raise Exception.CreateResFmt(@MY_RES_STRING, [parameters, go, here]); The second form is the one used everywhere in the RTL/VCL. It actually accepts a PResStringRec parameter. Up to now I also used that form in some of my internal libraries. But when I enabled the "Typed @ operator" compiler option today to get the compiler to find some errors in my code, it turned out that this form doesn't compile any more (in Delphi 2007, haven't tried anything else). Given that the first form works fine, why would I want to use the second form anyway?
  24. dummzeuch

    AV in GExperts with Themes

    I have never seen that problem, but I rarely use 10.3 and I don't use DevExpress at all. The call stack suggests that it happens in the drawing code somewhere, but apart from that I have no idea where to look.
×