Jump to content

David Heffernan

Members
  • Content Count

    3494
  • Joined

  • Last visited

  • Days Won

    172

Everything posted by David Heffernan

  1. David Heffernan

    How to open a file in the already running IDE?

    Of course, that would be assuming one's gender which isn't great. The French to their great credit have extended their language to include non-gendered pronouns. https://coucoufrenchclasses.com/the-coucou-guide-to-inclusive-and-gender-neutral-french/ https://blog.lingoda.com/en/french-gender-neutral-pronouns/
  2. David Heffernan

    How to open a file in the already running IDE?

    ma chérie mon chéri I am male, as you can infer from my forename. Therefore you use mon chéri. https://www.larousse.fr/dictionnaires/francais/chéri/15145 I'm surprised that Google translate gets this wrong. Although perhaps my French is even worse than I think it is!
  3. David Heffernan

    How to open a file in the already running IDE?

    Oh how it pains me to see my name in a post with a call to ShellExecute. That function should never be called because it doesn't offer proper handling of errors. Although it also shames me that my SO answer doesn't handle errors.
  4. David Heffernan

    Create multiple instances of tApplication with multiple MainThreads?

    Yes. But of course you need to define what thread safe actually means in this context. It's a very general term. For win32 the threading model is that all operations on a window must be performed in the thread that created the window. Queued messages for that window are delivered to the meesage queue of that thread. Nonqueued messages are synchronised onto that thread. This is not a free for all thread safety where you can do anything you want from any thread. This is why the term thread safety is often not useful. It's more useful to describe and summarise the threading model. In this case I always say that windows have thread affinity.
  5. David Heffernan

    Create multiple instances of tApplication with multiple MainThreads?

    This isn't really true. You can have multiple threads that serve multiple windows with different message loops. Windows supports that. What you can't do is do that in vcl.
  6. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    We still have no real clue what your code is doing. The excerpt you posted doesn't much help. Storing byte arrays in an ansistring is for sure broken. Always has been since unicode Delphi. But it's not clear you are doing that. You should stop hoping that it's a Delphi bug and look at your code. Almost certainly that's where the problem is.
  7. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    Char(11200) is a perfectly valid Char, and represents a well defined UTF-16 element. The issue is when you convert to AnsiString.
  8. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    What do you expect and intend to happen then with values of >= $80? I don't think anything has changed in recent Delphi releases, but your code may have been broken forever.
  9. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    That's on FireDAC I guess. AnsiString conversions works just fine in this scenario because it calls GetACP and uses the returned value (65001) for all conversions.
  10. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    It's almost as if posts from two completely different threads have somehow been interspersed with each other
  11. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    Fair. I was just looking at a statement about Chr(11200) in isolation. My bad. Off topic aside follows below: Interestingly, if the process has UTF-8 as the active code page (ccchttps://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page) then you can use AnsiString fine and be fully Unicode compliant. I discovered this by accident lately when my MATLAB mex file, which uses ANSI because MATLAB doesn't do UTF16, unexpectedly started handling Unicode with a recent MATLAB update! The update set this code page in its manifest.
  12. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    What is the encoding of the input. Can you guarantee that it is ascii?
  13. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    Thanks for the correction. The main point stands, namely that Chr(11200) is perfectly valid.
  14. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    It depends on the encoding of the 8 bit data. For all we know, that data could be ASCII. The problem is that the question doesn't have any actionable information, and the asked is just hoping for some silver bullet. Asker needs to get some real information rather than hope that people here can guess what's up.
  15. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    That's going to be a 16 bit Char with ordinal value 11200. It's KHOJKI LETTER A. See https://unicode-table.com/en/11200/ Nothing to see here
  16. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    I was pushing back against the quoted response, which was deeply unhelpful. As for what you need to do, I doubt the issue is with the update. I'd look to debug your code.
  17. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    You better hope you have two or more items in the collection when you execute that code. And as Stefan says, your code is nearly as bad a way to do this as possible. I think the only worse way is to call ToArray. There are plenty of ways to do this well, and it baffles me that you choose the poor solution when good solutions exist. Does quality not matter?
  18. David Heffernan

    Possible changes to string/char handling in Delphi 11(.2)?

    Nobody has any idea what the actual problem is, but yeah, let's just randomly through some AnsiStrings around. This approach to coding doesn't work. The monkeys still haven't typed Shakespeare yet..
  19. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    You can look at the list of public methods and properties. Why do you need us to tell you that what you want isn't there? Didn't all the responses suggesting alternatives indicate that?
  20. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    Push is Add. Pop is Extract(Count-1) and Peek is Items[Count-1] Contains won't help you because it checks the entire collection, not just the top two.
  21. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    Adding push pop and peek to TList is incredibly simple. I thought you wanted access to them all because you talked about searching the collection for a specific item. Do you not need to do that?
  22. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    Well, what's stopping you doing that? It's not a challenge. If you want random access to the entire collection, a stack isn't for you.
  23. David Heffernan

    TStack<T>.Peek deeper than the topmost element

    Seems like you want TList<T>
×