-
Content Count
3037 -
Joined
-
Last visited
-
Days Won
112
Everything posted by dummzeuch
-
Call for Delphi 12 Support in OpenSource projects.
dummzeuch replied to Tommi Prami's topic in Delphi Third-Party
The only problem I remember is that early versions required {$ifend} rather than {$endif}. Apart from that checking the compilerversion should work for all versions after Delphi 6 (I cannot speak for Delphi 8 though, I skipped it). -
Call for Delphi 12 Support in OpenSource projects.
dummzeuch replied to Tommi Prami's topic in Delphi Third-Party
That would make it harder to detect breaches of the NDA and start arguments about where the limits are. It's much easier to forbid any mention. -
Call for Delphi 12 Support in OpenSource projects.
dummzeuch replied to Tommi Prami's topic in Delphi Third-Party
It was introduced with Delphi 6. -
Delphi 11.3 lite. dosent work code completion
dummzeuch replied to NBilov's topic in Delphi IDE and APIs
What is "Delphi 11.3 Alexandria, lite"? That does not sound like something Embarcadero offers. -
Or you get a network named user license, then you can have as many installations as you like. You can only use (run) a limited number of these installations at the same time, but I don't remember how many. It's more than two though.
-
I've got a tab on our About dialog that lists all open source libraries used in the project based on checking whether a specific unit is linked to the executable. The idea there is to automatically provide credits to these, but it could be extended to also include commercial libraries as well. Just find a unit name in these libraries that is always llinked in when the library is used. It looks like this: That's not quite an SBOM, but it is a good start, I think. Of course this only makes is easier to get such a list if you have more than a few programs, otherwise doing it manually would not be such a chore either. Here is the Stack Overflow question that got me started on how to do that: https://stackoverflow.com/q/12104914/49925
-
I have just finished the first (sort of) working version of a new Grep Expert in GExperts. My working title for it is "Fast Grep", but I don't really like that. Perhaps you can suggest a better name? It does the following: It opens a new (dockable) window in which you can enter a regular expression. As you type (with a short delay after the last keystroke), it runs the RegEx on the current editor window. It then displays a list of all matches in the window, giving the filename, line number and some context (I took this code from the Bookmarks Expert). You can then use the up/down arrow keys to scroll through these matches. While you do that the cursor in the editor window will move to the row/column of the currently selected entry. Pressing Enter closes the Fast Grep window and your cursor will end up at the selected match position. Pressing Esc will also close the Fast Grep window and move the cursor back to where it was when you started Fast Grep. The current source code in svn already contains this functionality, just in case you want to check it out. Beware that this is a work in progress and pretty much untested!
-
Thanks for the suggestions. So far I like InstantGrep and LiveGrep best. InstantGrep might be better because LiveGrep in my opinion suggests that it also updates when the source code is changed or even when switching to a different tab, which at least currently is not the case and I am not sure I want to go that way. Some other suggestions at least made me smile. Thanks for these too.
-
Pre-sets for the GExperts stand alone Grep tool
dummzeuch posted a topic in Tips / Blogs / Tutorials / Videos
When running stand alone, GExperts Grep Results can not be opened in the IDE. Instead an external text editor is used. This editor and the required parameters to open the file and set the cursor at the desired line and column must be configured in the File → Options menu. I have now added buttons with the pre-sets for some popular ... read on in the blog post. -
Way for external app to jump to a unit and position inside the IDE?
dummzeuch replied to domus's topic in Delphi IDE and APIs
I don't think this will work as the editor control (TEditControl) does not descend from TEdit or TMemo but from TWinControl (via TCustomControl -> TCustomEditControl): But I might be wrong, maybe one of those controls processes this message. Edit: TMemo descends from TCustomEdit (which itself descends from TWinControl), not from TCustomEditControl. -
Hm, that's odd. I just tried it again with Delphi 11 just to be sure (before I used 11.2). Again, Shift+Alt+S and Ctrl+Alt+R worked fine for me. But then I assigned Shift+Alt+S as shortcut to the "Grep" entry rather than to the "Grep Search" entry and got the same popup menu as you. So it's likely that it's the same in your configuration:
-
You can still assign individual shortcuts to "Grep Search" and "Grep Results", and there is no need to assign a shortcut to "Grep" (the submenu). In fact that's the default. And for me it works the same way as it always has.
-
Way for external app to jump to a unit and position inside the IDE?
dummzeuch replied to domus's topic in Delphi IDE and APIs
AFAIK this can only be done using the OTAPI which is only available for IDE plugins. -
Just going by the error message JTAfterEdit might need a parameter of type TDataset rather than TObject.. No idea whether that's correct, I haven't done any database programming for years. But also: Shouldn't JTAfterEdit be a method rather than a procedure?
-
It has always irked me that in C you can write: while (0<(BytesRead=Read(...))) { // .. } But in Delphi you have to use the much less readable BytesRead := Stream.Read(Buffer, BufSize); while BytesRead > 0 do begin // .. BytesRead := Stream.Read(Buffer, BufSize); end; Today I had enough and wrote these simple helper functions: function TStream_TryRead(_st: TStream; var _Buffer: TBytes; _Count: Int32; out _BytesRead: Int32): Boolean; overload; inline; begin _BytesRead := _st.Read(_Buffer, _Count); Result := (_BytesRead > 0); end; function TStream_TryRead(_st: TStream; var _Buffer; _Count: Int32; out _BytesRead: Int32): Boolean; overload; inline; begin _BytesRead := _st.Read(_Buffer, _Count); Result := (_BytesRead > 0); end; function TStream_TryRead(_st: TStream; _Buffer: TBytes; _Offset, _Count: Int32; out _BytesRead: Int32): Boolean; overload; inline; begin _BytesRead := _st.Read(_Buffer, _Offset, _Count); Result := (_BytesRead > 0); end; function TStream_TryRead(_st: TStream; _Buffer: TBytes; _Offset, _Count: Int64; out _BytesRead: Int64): Boolean; overload; inline; begin _BytesRead := _st.Read64(_Buffer, _Offset, _Count); Result := (_BytesRead > 0); end; With these you can write: while TStream_TryRead(Buffer, BufSize, BytesRead) do begin // .. end; Yes, that's far from being rocket science. It's probably possible to convert these into a class helper, but I can't be bothered. (Original Blog post.)
-
while TStream_TryRead() do
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Shouldn't that be until BytesRead <= 0 ? Hm, And where does the code to process those bytes go in this case? I admit I should have included a call for that in my original example. Something like this: while TStream_TryRead(Buffer, BufSize, BytesRead) do begin Process(Buffer, BytesRead) end; Because what's the point in reading from the stream when you just throw away the data read from it? Unless of course you want to simply empty the stream. Of course, the Process procedure itself could check whether the BytesRead parameter is <= 0. In that case a repeat loop would work: repeat BytesRead := Stream.Read(Buffer, BufSize); Process(Buffer, BytesRead; until BytesRead <= 0; But that just means that the if statement goes into the Process procedure instead of the loop: repeat BytesRead := Stream.Read(Buffer, BufSize); if BytesRead > 0 then Process(Buffer, BytesRead; until BytesRead <= 0; -
while TStream_TryRead() do
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
That depends on what you want to do with these bytes. It might be crucial to process them as fast as they can be read. E.g. if they come from a device (e.g. via serial port) and you need a time stamp to know when exactly they were received (Yes, I know from experience that this would be far from reliable. We are talking Windows, not some real time OS here.) -
We currently are using TIdTCPClient and TIdTCPServer from Indy10 for communication between applications written in Delphi 2007, so all strings are AnsiStrings. Now I have got the first program that is written in Delphi 10.2, so all strings are now Unicode strings. Is there anything special I need to do so it can communicate with the existing server which is still written in Delphi 2007? Edit: Strings here are only used for text (commands and parameters) not abused as buffer for binary data.
-
while TStream_TryRead() do
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Hm, an endless loop with an obscured break is not quite what I would call elegant and easily readable. But yes, that's one way a repeat loop "would do the trick". -
while TStream_TryRead() do
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Care to provide an example? -
Project Options -> Version Info aka. dproj madness
dummzeuch replied to Attila Kovacs's topic in Delphi IDE and APIs
https://blog.dummzeuch.de/2015/09/26/using-my-buildtools/ Actually, it's even older: http://www.dummzeuch.de/delphi/dzprepbuild/englisch.html -
Project Options -> Version Info aka. dproj madness
dummzeuch replied to Attila Kovacs's topic in Delphi IDE and APIs
I haven't got a build server, but use the post build event in the IDE (and in command line builds) instead. -
Project Options -> Version Info aka. dproj madness
dummzeuch replied to Attila Kovacs's topic in Delphi IDE and APIs
Since the version info stuff never really worked very well since at least Delphi 2005, I don't use the IDE to manage the version info but create a version info resource externally and link it to the executable. As as side effect, I have no more annoying changes in the dproj file that show up in SCM with every build. -
If you need to do that more than once: If you have got an active subscription, I suggest to have your license converted into a Network Named User license (As far as I know that's possible any time and does not cost anything. Ask Embarcadero.). This will allow you as many installations as you like as long as the user name is the same on all installations. You'd need to run the Embarcadero License Center on the network though, but that can also be a virtual machine. I blogged about that a while ago. If it's only this one time: The License used to be bound to the computer name (I think that's still the case) and you could copy the contents of the directory C:\ProgramData\Embarcadero to the new machine (But again: You have to use the same computer name for this to work, which is only possible if only one computer with that name is on the Network at any time.) If that doesn't work, try a new online activation. If that doesn't work because you have already reached the maximum number of possible installations (2!) the you need to contact Embarcadero sales to bump the number of activations for you.
-
I'm sure everybody else noticed that a bot has started to spam this forum using several accounts. The motive behind this is trying to promote fake airline phone numbers for scamming people. And apparently nobody who can do something about it, has so far noticed.