Jump to content

Kryvich

Members
  • Content Count

    407
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Kryvich

  1. Kryvich

    I'm looking for these menus in the IDE

    It's hard to find a good short shortcuts in IDE that are still free. I found Ctrl-Shift-NumPad- / NumPad+, and made a new plugin for Delphi. You can download it from GitHub and compile for Berlin. https://github.com/Kryuski/Editor-Shortcuts
  2. @uligerhardt It seems that it does not. Neither for records, nor for arrays. function GetRec: TRec; begin // Forgot to assign Result... end; function GetArr: TArray<Integer>; begin // Forgot to assign Result... end; var rec: TRec; arr: TArray<Integer>; begin rec.Data := 255; rec := GetRec; Writeln('rec.Data = ', rec.Data); // = 0 SetLength(arr, 1000); arr := GetArr; Writeln('Length of arr = ', Length(arr)); // = 0 Readln; end.
  3. Kryvich

    I'm looking for these menus in the IDE

    Found on Stack Overflow:
  4. Kryvich

    I'm looking for these menus in the IDE

    Well I found the bindings: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Code_Editor
  5. Kryvich

    I'm looking for these menus in the IDE

    I did not find any bindings for them, but it’s possible to write a small package that will add such functions and keyboard shortcuts for them. The best option would be if the IDE would allow the user to customize the keyboard shortcuts for all actions.
  6. Kryvich

    I'm looking for these menus in the IDE

    @Attila Kovacs OK I found them too in TEditorActionLists. I do not think these are some "secret" functions. As I understand, they move cursor to the previous/next line in the editor, marked as modified (yellow bar) or saved (green bar).
  7. Still, it is not clear why the compiler did not issue a warning about an unassigned Result. I minified the code to make it clearer. program TestUnassignedResult; {$APPTYPE CONSOLE} type TRec = record Data: Byte; function NS: TRec; end; function TRec.NS: TRec; begin Writeln('I''m in NS'); // W1035 Return value of function 'NS' might be undefined <-- not showed!!! end; begin //.. end.
  8. Kryvich

    I'm looking for these menus in the IDE

    Yes, I used "Go to next difference" / "Go to previous difference" on the tool bar (34s - 42s on the video). I did not found any special buttons for "Next Unsaved Modification" / "Previous Unsaved Modification". You should compare Buffer and File to see unsaved modifications. Having said that, I should note that I usually use a third-party utility for text comparisons: Compare-It. It allows not only to compare, but also to modify files if necessary.
  9. Kryvich

    I'm looking for these menus in the IDE

    Works for me:
  10. Kryvich

    Editor Status Bars for Delphi IDE

    @Attila Kovacs Fair remark. I made this conclusion from the article (see GIF above). In fact, I did not know that these icons can be turned off (Tools | Options | Editor options | Display | Show image on tabs). Looks even better, thank you for the tip! In addition to 10.2.3 CE, I have XE2 and older versions here. I do not have access to Delphi XE3 - 10.2.2. So if you're interested, I can try to recompile the package for the Delphi XE2. The plan for my future open-source and free projects is to move to 10.3 Community Edition when it will be available.
  11. One more possibility with const parameter and a predictable behavior: procedure Test2(const [Ref] rec: TTestRec); begin rec.Change( 2 ); Writeln('Inside Test2: ', rec.Value ); // 2 end; http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Parameters_(Delphi)#Constant_Parameters
  12. A few suggestions for the post layout in the desktop version of community: Shift the icon a little higher Remove "Members" Optionally remove the reputation and posts number, we can see this information by hovering mouse over the icon. Move the blocks as showed by the arrows. People who came from Google+, are accustomed to a light design without optional elements. Thank you for the forum, it can be the best place for communications!
  13. Kryvich

    Suggestions for a message layout

    @rvk They can remove only "members" and leave others as is. This is how it is implemented on G+.
  14. @Uwe Raabe Ouch! The behavior depends of record size.
  15. @Cristian Peța After a complete rebuild, hints began to appear lightning fast. I suppose, until the project was fully compiled, IDE ran the background compiler each time it tried to show a hint. That is why the freezes occurred. This can be solved by putting the code completion into a separate thread.
  16. @Schokohase But if you check the value inside Test2: rec.Change( 2 ); Writeln('Inside Test2: ', rec.Value ); // 2 Now I understand why they use var instead of const in the constructor: the const record parameter passed by value, not by reference.
  17. @Cristian Peța I've change it like this: Pointer(buf):=@buffer[kk]; And yes, too much of hints and warnings. But as a test sample for IDE developers is great.
  18. Thank you for mentioning a really big open-source project that I can test on my Delphi 10.2.3 CE. Yes, the same thing happens to me. (IDE FixPack installed.) It would be nice if Delphi developers tested their product on this project. (6 minutes to rebuild the project is a record for me.) At yesterday's webinar "See What’s Coming in 10.3 Rio", they mentioned that the code completion in the new C++Builder will work in a separate thread and not block the editor. I hope they can later implement this function in Delphi too.
  19. @Uwe Raabe True remark. It is important that the source variable itself is not changed, so it must be declared as const.
  20. @Cristian Peța Yes, but the source can be constant, or a constant parameter of a method. procedure TestRec(const DoNotChangeMe: TManagedRecord); begin ... var tempRec := DoNotChangeMe; ... end;
  21. At today's webinar, new custom managed records in Delphi have been shown. There was such a declaration: And the implementation of operator Assign: class operator TMyRecord.Assign(var Dest: TMyRecord; var Src: TMyRecord); begin Dest.Value := Src.Value; end; Is there an error here? Perhaps it would be more correct to write const Src: TMyRecord? Because the above declaration allows you to change the Src variable: Src.Value := Dest.Value; Even better it would be to write it as class operator TMyRecord.Assign(const Src: TMyRecord): TMyRecord; begin Result.Values := Src.Value; end; And prohibit to change the variable Result itself (it's preallocated).
  22. Yes, I get it. Just kidding. In small companies where I worked, the above usually happens.
  23. @David Heffernan Pascal was designed by Wirth with a Static Strong Safe typing in mind. The proposed compiler warning follows this concept. It can help prevent some semantic errors and write a clean code, without the need to complicate a code by introducing new structured types. So It's good for Delphi programmers and for Delphi, a win-win situation.
  24. Who sweeps your office floor? :)
  25. It's interesting that for spawned class types there is a special type check: type TApple = class end; TOrange = type TApple; // Identical inside but not the same semantically procedure TestApplesAndOranges; var apple: TApple; orange: TOrange; begin apple := TApple.Create; orange := apple; // <-- [dcc32 Error] E2010 Incompatible types: 'TOrange' and 'TApple' end; Great! Update: But: orange := TOrange.Create; // E2010 Incompatible types: 'TOrange' and 'TApple' orange := TApple.Create; // E2010 Incompatible types: 'TOrange' and 'TApple' Hmm. So what is the orange that I have declared? We can find out like this: var orange2: TObject; ... orange2 := TOrange.Create; ShowMessage(orange2.ClassName); // 'TApple' This is the correct answer (the classes are the same inside). Only it is not clear why orange := TOrange.Create; does not compile...
×