Jump to content

JonRobertson

Members
  • Content Count

    171
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonRobertson

  1. JonRobertson

    State of an uninitialised variables..

    Agreed. I still think the code demonstrated in the report (and the example posted by Der schöne Günther) is unexpected behavior. objectAsString := 'Hello World'; objectAsString := TJson.Format(objectAsJson); WriteLn(objectAsString); // << It is "Hello World{}" (not including linebreaks) I would not expect 150 to be written to the console for this code: function GetAmount: Integer; begin Result := 50; end; begin var i: Integer := 100; i := GetAmount; writeln(i); end. The compiler even hints that the initial value is never used. [dcc32 Hint] H2077 Value assigned to 'i' never used
  2. JonRobertson

    IDE freezing

    When I started using Delphi 11.x, I was frustrated by frequent IDE lockups and exceptions. After talking to Embarcadero, I selectively uninstalled each component library and expert to try and identify if third-party code was causing those issues. The issues that I was experiencing disappeared once I uninstalled the Parnassus debugger and bookmarks experts. Since then, Delphi 11.3 has been extremely stable for me. Jon
  3. JonRobertson

    IDE freezing

    I copy components from the designer to clipboard quite frequently and I do not recall that issue ever occurring. The most recent versions that I have used are 11.2, 11.3, and 12.0 (without Patch 1). I would also check Task Manager to see what else is running in the background. There could be another application that is monitoring the clipboard and interfering with BDS.exe when you try to copy components.
  4. JonRobertson

    Real time desktop colors change like filters

    Colors for the entire desktop, including icons, taskbar, and start menu? Or change only the colors in the desktop wallpaper?
  5. JonRobertson

    State of an uninitialised variables..

    I do believe our "issue" was with a String return value rather than a local variable. It amazes me that after using Delphi for 28 years, there are still things, even basic features, that I haven't learned. Thank you for your post, which led to a search, then to so initialise-string-function-result, and then to this in the docs: For a string, dynamic array, method pointer, or variant result, the effects are the same as if the function result were declared as an additional var parameter following the declared parameters. In other words, the caller passes an additional 32-bit pointer that points to a variable in which to return the function result.
  6. JonRobertson

    Delphi 12.1 is available

    The IDE only opens the file once, regardless of how many tabs are "editing the same unit". Designer and Code Note: Remember, there is only one file (module or file buffer in internal terms), but multiple editor views over that file, so a change you make in one editor is always reflected in every other editor for the same file. A change made in one editor is not ‘copied’ or ‘duplicated’ or anything else: there is only one file and one content for that file, even if you have multiple editors viewing/editing that file. Another way of saying this is that when you edit a file in one editor, that change is in the file itself, not the editor. By definition, that means that change is always present in the other editors also showing the same file.
  7. JonRobertson

    State of an uninitialised variables..

    I do as well. I even initialize strings and arrays. Although I have not seen this occur in years, I had an issue, around 15 years ago, in a Delphi 6 project where a local string variable was not initialized to empty string.
  8. JonRobertson

    Do you need an ARM64 compiler for Windows?

    I do as well. Such as weird UI issues that do not occur in 32-bit but do occur in 64-bit, which I've encountered more than once.
  9. JonRobertson

    Do you need an ARM64 compiler for Windows?

    I still have problems using the "integrated" (sort of) debugger with Win64 projects.
  10. It does not. I just installed R43 in Delphi 11.3.
  11. Downloaded and installed. This is very helpful, even without adding custom visualizers. I looked on sf for a way to add an "issue" and checked the blog. I suppose you want all feedback to be on this post. In Tools Options, after clicking "Add Defaults", I then deleted each of the items that were added. Except the Delete button does nothing when there is a single item in the list.
  12. JonRobertson

    DelphiLint v1.0.0 released!

    For anyone that has DelphiLint installed, I just filed ticket Issue 20 because BDS.exe was racing one logical CPU when the IDE was otherwise idle and no projects were loaded. Once I removed the Delphi Lint package, BDS.exe CPU usage dropped to 0%. Delphi 11.3 (28.0.48361.3236) DelphiLintClient-1.0.1-Alexandria.bpl delphilint-server-1.0.1.jar plugins\DEFAULT-sonar-delphi-1.3.0.jar
  13. JonRobertson

    DelphiLint v1.0.0 released!

    It could be. I followed the instructions and was in a console window when starting the service. I don't remember anything written to the console window that would have indicated the problem was related to that issue. Now that DelphiLint standalone is working, next week I may installing SonarQube again and try to get a "connected" configuration working. I still need to install our certificate in the JVM and verify that DelphiLint is able to download SonarDelphi. My opinion is that naming convention is not a risk factor, which is the benefit of static analysis. Perhaps there is a risk that I am not aware of. I could see the benefit of those rules being available, just turned off by default. Another example is the default name of a "break" in a menu (main menu or popup menu). The default is "N1" for the first break, "N2" for the second, etc. Sonar suggests that I give those menu items a more meaningful name. As an experienced Delphi developer, naming it "miBreak1" is no more meaningful than "N1", because I know what they are and I don't need to reference them in code.
  14. JonRobertson

    DelphiLint v1.0.0 released!

    https://github.com/integrated-application-development/sonar-delphi/issues/211
  15. JonRobertson

    DelphiLint v1.0.0 released!

    I definitely would appreciate customizing rules in standalone mode. I attempted installing SonarQube and going the "connected mode" route. However, I had difficulty getting the SonarQube service started and I am not a Java guy. Some of the rules are more annoying than helpful. I have no idea what "naming conventions" DelphiLint is expecting. One convention seems to be that unit names must be PascalCase. Particularly for legacy projects, there is no benefit. Yes, a consistent naming convention is very helpful. Does anyone care that all of our form units follow formMain.pas rather than FormMain.pas? I almost want to create an issue for the rule "split this 128 characters long line (which is greater than 120 authorized)". Authorized by who, or what? Certainly not by me, my employer, or anything that I've configured in Delphi. Others are personal preferences. "Delphi style guides" may advise against using () when calling a routine without arguments. But I prefer to have them. They do no harm and I think they improve code read-ability. Those are just a couple examples where the ability to customize the rules, even in standalone mode, would be appreciated.
  16. I've never heard of the Delphi IDE "using" an external editor. The integration between the editor and the rest of the IDE (designer, object inspector, tool palette, etc) would likely need a heavy refactor or rewrite. But as @Lars Fosdal mentioned, you can edit Pascal source in any text editor. The project below is a Delphi plug-in that adds a command to the Tools menu to open the current unit in Visual Code. With a little configuration, you could switch between Delphi and Visual Code at will, taking advantage of features in Visual Code such as Copilot. EditInVsCodeDelphiPlugin
  17. JonRobertson

    Editor: name of this vertical line

    The editor right margin. It is configurable: Tools->Options->User Interface->Editor->Display, in "Margin in gutter" section, "Right margin"
  18. JonRobertson

    Taskbar Icon Menu.

    Search for JumpList.TJumpList. Here are a few links to get you started. https://docwiki.embarcadero.com/RADStudio/Athens/en/VCL_Taskbars https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.JumpList.TCustomJumpList.AddTask https://blog.marcocantu.com/blog/2014-september-vcl-xe7-taskbar-jumplist.html https://perevoznyk.wordpress.com/2011/05/25/adding-windows-7-jump-list-to-a-delphi-2010-application/
  19. A project that I inherited has warning "W1047 Unsafe code" enabled. I normally do not enable that warning. There is a scenario that I don't understand, even after some online searches. [dcc32 Warning] W1047 Unsafe code 'String index to var param' From a couple posts that I read, it seems this specific unsafe warning is related to multiple platform support and zero based strings. It occurs in this (totally useless) code segment: function Test(const aStr: String): String; begin SetLength(Result, Length(aStr)); var Count := 0; for var i := 1 to Length(aStr) do begin Inc(Count); Result[Count] := aStr[i]; end; end; on Result[Count] := aStr; The wording of the warning confuses me. There is an index to a string, but not what I consider a 'string index'. Does the [] operator for String receive the index as a var param?
  20. Yes you do, as long as you have the source code. You have complete control over when a DM is created.
  21. JonRobertson

    DelphiLint v1.0.0 released!

    I suggest creating an Issue here. And there is no reason for an option to be added. The plug-in should determine the correct paths and Delphi version without needing you to configure it.
  22. JonRobertson

    DelphiLint v1.0.0 released!

    Done. Issue 207
  23. JonRobertson

    DelphiLint v1.0.0 released!

    Thanks for the extra info. Downloaded and renamed. The first unit that I tried to analyze gave this error: DelphiLint encountered a problem during analysis. An error was raised (java.lang.OutOfMemoryError: Java heap space ). That unit has 464 lines of code. The entire project has 12,533 lines of code, not counting Delphi RTL, VCL, and third-party components. So this isn't a large project by any means. This laptop has 32GB of physical memory and 13.5 GB was available at the time of the analysis.
  24. JonRobertson

    Minimal working Example for libgit2-delphi

    Your original declaration declared a pointer, but never assigned it to anything. Since it is a local variable on the stack, it contained a garbage/random value rather than a pointer to actual data. Darian's suggestion changed your declaration to an instance of data. Using @repoPP then passed the memory address (pointer) of the data to the DLL. See The @ Operator
  25. JonRobertson

    DelphiLint v1.0.0 released!

    I am curious what the "standalone" version would download from GitHub. Following the link to install SonarDelphi, you need to install SonarQube, then SonarScanner, then install the SonarDelphi plug-in in SonarQube. I installed SonarQube and configured a database via the install instructions. But the SonarQube service refuses to start.
×