-
Content Count
407 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Kryvich
-
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
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 -
JMP to expernal methods <> inlined call to external method, bug or correct design?
Kryvich replied to Johan Bontes's topic in RTL and Delphi Object Pascal
@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. -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
Found on Stack Overflow: -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
Well I found the bindings: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Code_Editor -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
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. -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
@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). -
JMP to expernal methods <> inlined call to external method, bug or correct design?
Kryvich replied to Johan Bontes's topic in RTL and Delphi Object Pascal
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. -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
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. -
I'm looking for these menus in the IDE
Kryvich replied to Attila Kovacs's topic in Delphi IDE and APIs
Works for me: -
@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.
-
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
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 -
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!
-
@rvk They can remove only "members" and leave others as is. This is how it is implemented on G+.
-
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
@Uwe Raabe Ouch! The behavior depends of record size. -
IDE hangs on code completion, find declaration, parameters tooltip.
Kryvich replied to vhanla's topic in Delphi IDE and APIs
@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. -
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
@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. -
IDE hangs on code completion, find declaration, parameters tooltip.
Kryvich replied to vhanla's topic in Delphi IDE and APIs
@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. -
IDE hangs on code completion, find declaration, parameters tooltip.
Kryvich replied to vhanla's topic in Delphi IDE and APIs
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. -
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
@Uwe Raabe True remark. It is important that the source variable itself is not changed, so it must be declared as const. -
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
@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; -
Custom Managed Records Coming in Delphi 10.3
Kryvich replied to Marco Cantu's topic in RTL and Delphi Object Pascal
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). -
SDTimes Industry Watch: The developer transformation
Kryvich replied to Lars Fosdal's topic in Project Planning and -Management
Yes, I get it. Just kidding. In small companies where I worked, the above usually happens. -
Clean Code and Fast Code Slides at EKON 22
Kryvich replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
@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. -
SDTimes Industry Watch: The developer transformation
Kryvich replied to Lars Fosdal's topic in Project Planning and -Management
Who sweeps your office floor? :) -
Clean Code and Fast Code Slides at EKON 22
Kryvich replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
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...