-
Content Count
3494 -
Joined
-
Last visited
-
Days Won
172
Everything posted by David Heffernan
-
How to open a file in the already running IDE?
David Heffernan replied to aehimself's topic in Delphi IDE and APIs
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/ -
How to open a file in the already running IDE?
David Heffernan replied to aehimself's topic in Delphi IDE and APIs
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! -
How to open a file in the already running IDE?
David Heffernan replied to aehimself's topic in Delphi IDE and APIs
mon chéri -
How to open a file in the already running IDE?
David Heffernan replied to aehimself's topic in Delphi IDE and APIs
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. -
Create multiple instances of tApplication with multiple MainThreads?
David Heffernan replied to microtronx's topic in VCL
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. -
Create multiple instances of tApplication with multiple MainThreads?
David Heffernan replied to microtronx's topic in VCL
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. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
Char(11200) is a perfectly valid Char, and represents a well defined UTF-16 element. The issue is when you convert to AnsiString. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
It's almost as if posts from two completely different threads have somehow been interspersed with each other -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
What is the encoding of the input. Can you guarantee that it is ascii? -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
Thanks for the correction. The main point stands, namely that Chr(11200) is perfectly valid. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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 -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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. -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
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? -
Possible changes to string/char handling in Delphi 11(.2)?
David Heffernan replied to omnibrain's topic in General Help
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.. -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
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? -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
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. -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
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? -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
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. -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
Make me yak -
TStack<T>.Peek deeper than the topmost element
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
Seems like you want TList<T>