-
Content Count
3494 -
Joined
-
Last visited
-
Days Won
172
Everything posted by David Heffernan
-
Modal dialog closes before user input
David Heffernan replied to John Savoury's topic in RTL and Delphi Object Pascal
So why continue doing things in key up? -
Modal dialog closes before user input
David Heffernan replied to John Savoury's topic in RTL and Delphi Object Pascal
This sounds like you are papering over the problem. -
Modal dialog closes before user input
David Heffernan replied to John Savoury's topic in RTL and Delphi Object Pascal
Why are you doing anything in response to key up? Try using some respectable programs and see which of them perform actions on key up. Once you have done that, remove TDropDownDialog.ListBox1KeyUp and see how things behave. -
Ask for comments to improve this code
David Heffernan replied to Berocoder's topic in Algorithms, Data Structures and Class Design
It sounded like you might be accessing an object after it has been destroyed which is obviously incorrect. -
Modal dialog closes before user input
David Heffernan replied to John Savoury's topic in RTL and Delphi Object Pascal
It's presumably the handling of KeyUp that sets the modal result. If the modal dialog is shown by mouse action, then happens on mouse up. But if shown by keyboard action, it is shown on key down. Then the matching key up is handled by the modal form which immediately closes. -
Ask for comments to improve this code
David Heffernan replied to Berocoder's topic in Algorithms, Data Structures and Class Design
Pascal Analyser is wrong. Seems pointless to test with is TBoldObject and then cast with as. Once is tells you the cast is valid then go ahead and use an unsafe cast. Seems dubious to cast one object to be a class from an unrelated hierarchy. Don't know how that could be valid. Also, what is BoldObjectIsDeleted all about? Don't tell me this flag is set to true when the instance is destroyed. -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
It goes from bad to worse!! -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
We don't need any context to know that a fixed length array shouldn't be named a tuple. -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
But it's a tuple too. My question was really for Stefan though. -
The best way to handle undo and redo.
David Heffernan replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
Very rare to find a scenario where this works well. The serialised state can be huge. And the asker here has a database to work with. You are going to serialise that in its entirety? -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
OK. What name would you give this type array [0..2] of Double -
The best way to handle undo and redo.
David Heffernan replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
If there can be multiple users modifying the same database then this task becomes very challenging. -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
That's a pair not a tuple -
Seems like a clear instruction to ignore future posts asking for help and instead laugh.
-
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
Whilst you can, this doesn't feel like a great idea. It's one thing returning a tuple in a language like Python with support for unpacking. But a Delphi dynamic array should be used for arrays, things where each item is a different value of the same thing. That's not the case here. They are two distinct things. Use a record, or two out params. -
Converting a very long text to concatenated strings?
David Heffernan replied to PeterPanettone's topic in GExperts
This is why programmers learn to use scripting languages -
That's clear from the code but we don't know what it's life time is. On the face of it, exactly as you say, TList<string> or TStringList would be much more suitable. But my reticence is that there are lots of unknowns.
-
What is sublist and what is FHintCell. It's all just guesswork. But having pointer to pointer to character array feels odd to me.
-
It looks a bit odd but because we don't know for sure what all of the types and objects are, and your extracted code has arguments that aren't used, I don't think it's easy to offer specific advice. However, it's hard to imagine a scenario where this code would be the best way to do anything.
-
Yes that looks correct but it's also a very odd thing to do. What version of Delphi are you using?
-
Package SynEdit library as Dll
David Heffernan replied to Surendra Singh's topic in Delphi Third-Party
MPL allows any license of the derived product I think. And the source code in the synedit 2 repo says the license is MPL. But asker believes that putting the code in a dll means that they don't need to worry about the license. Which is nonsense obviously. And in any case, even if it did make a difference, use a package already!! -
Package SynEdit library as Dll
David Heffernan replied to Surendra Singh's topic in Delphi Third-Party
Do remember to make sure that you meet the requirements of the open source MPL license -
Are you holding records or pointers to records? Because the question only makes sense if the latter. If the latter then something needs to allocate and deallocate. But i suspect that you are doing the former.
-
Dynamic linking won't solve your licensing problems. Synedit, the subject of your last question, has a dual GPL/MPL license. Dynamic linking doesn't allow you to evade the licence requirements. Why do you feel that you can't adhere to the requirements of the MPL? Incidentally there was no need to make a new question to ask the same as you did in your previous question. Perhaps you didn't like the answers you got but sometimes the answer to a question isn't the one you want to hear.
-
It's as if you don't want people to help you.