Jump to content

dummzeuch

Members
  • Content Count

    2634
  • Joined

  • Last visited

  • Days Won

    91

Everything posted by dummzeuch

  1. dummzeuch

    String literals more then 255 chars

    That "multiline(...)' example was just the first thing that came into my mind. I just wanted to show something easier to recognize than these three quotes. Unfortunately the parser is quite complicated as it is now (I wouldn't have written it that way, but I also don't want to take the time to rewrite from scratch), so I wouldn't bet on the tweak being not too complicated. We'll see.
  2. dummzeuch

    String literals more then 255 chars

    Not quite the implementation I would have liked though. Triple quotes '''? Who came up with that? Is that copyied from another programming language? I mean, Pascal is said to be very verbous, so why not somehing more explicit like: blub := multiline(' line1 line2, indented line3 '); People who don't like verbosity would complain of course, but these would complain about Pascal syntax anyway. (Goes away, silently weeping and anticipating yet another long night trying to adapt the GExperts Source Formatter to yet another string syntax ...)
  3. dummzeuch

    Export a thread??

    As with any website: Print it. On paper, if you want to add notes. To pdf and send it to your ebook reader, if you prefer that.
  4. dummzeuch

    Turning off updates in Windows 10 laptop

    The only sure way I know to prevent windows from updating is to disconnect it from the internet. That can be easily done with a virtual machine. Alternatively it's probably possible to only block it from accessing Microsoft servers. Of course there is the option to pause updates, but that only works for up to one month and has to be extended regulator after that. And it won't prevent an update to the next Windows 10 release when support runs out.
  5. dummzeuch

    shortcut keys prev/next identifier reference

    The easiest solution would probably be to assign different shortcut keys. No idea which part of the IDE now uses them.
  6. Did Embarcadero buy SmartInspect? When? Last time I looked, it belonged to Code Partners Pty. Ltd.
  7. dummzeuch

    Call for Delphi 12 Support in OpenSource projects.

    Why not just use IFEND for all? {$LEGACYIFEND ON} switches XE4+ back to the old behaviour. (Didn't know that, it never mattered to me, as I always had to support some older Delphi version anyway.)
  8. dummzeuch

    Call for Delphi 12 Support in OpenSource projects.

    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).
  9. dummzeuch

    Call for Delphi 12 Support in OpenSource projects.

    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.
  10. dummzeuch

    Call for Delphi 12 Support in OpenSource projects.

    It was introduced with Delphi 6.
  11. What is "Delphi 11.3 Alexandria, lite"? That does not sound like something Embarcadero offers.
  12. dummzeuch

    Help with Delphi Community Edition

    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.
  13. dummzeuch

    SBOM tool for Delphi

    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
  14. 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!
  15. dummzeuch

    New Grep Expert in GExperts - need a name

    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.
  16. 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.
  17. 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.
  18. dummzeuch

    GREP menu and shortcut misery

    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:
  19. dummzeuch

    GREP menu and shortcut misery

    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.
  20. AFAIK this can only be done using the OTAPI which is only available for IDE plugins.
  21. dummzeuch

    What am I missing here??

    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?
  22. 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.)
  23. dummzeuch

    while TStream_TryRead() do

    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;
  24. dummzeuch

    while TStream_TryRead() do

    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.)
  25. 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.
×