Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    TBitmap32 to jpg (graphics32)

    I'm not aware that the VCL jpeg unit leaks. How are you measuring that?
  2. David Heffernan

    Creating my own .bpl

    I still don't really understand why people use packages other than for IDE plugins and components.
  3. Abs isn't going to help at all. The problem is that the compiler is seeing these values as 32 bit integers. Which is why I suggested the Int64 cast. But Brian appears to have the answer by the excellent method of reading the documentation. I should have done that!
  4. David Heffernan

    TBitmap32 to jpg (graphics32)

    I'm confused. The VCL ships with a JPEG encoder.
  5. Compiler sees these as 32 bit Integer. Does it help to write Int64(10000000000) .. Int64(99999999999) Also your case statement doesn't handle negative input values.
  6. It is utterly trivial to make such a thing using the exact same code as found in Random. You make a record that contains a seed and you add a method that uses that seed to generate the next sample, and then update the seed. If you have specific requirements for the properties of the PRNG then you may find the LCG used by Random doesn't meet them. In which case you'd need to decide what your requirements are.
  7. David Heffernan

    Conditional compiling - Delphi has a bug

    You can see exactly this in the original post above. That's not the question being asked though.
  8. David Heffernan

    IfThen Oddity...

    IfThen as a function sucks big time. Why can't we have a conditional operator?
  9. I'm not convinced by this. But then I was primarily reacting to what you wrote.
  10. Looking at the update are you sure the function takes pointer to pointer to pointer to struct?
  11. We don't know what PDoubleArray1 is because the definition isn't here. However, you pass @Testdoublearray which is a pointer to pointer to record. But the native code expects pointer to struct. Clearly a mismatch. Given the various edits that have gone on between the real code and the code you posted, this could be wrong.
  12. True, but so what? If you want slim executables you wouldn't be using Delphi at all.
  13. David Heffernan

    Modal dialog closes before user input

    Reason is exactly as I described in my first comment. Down and up come in pairs. If one part of your program responds to down and another to up then you can have a down up pair invoking two distinct actions. Down invokes form show modal, up invokes closing that form. More prosaicly, if there is a common uniform way to do something in the system, your default should always be to follow that common uniform convention.
  14. David Heffernan

    Modal dialog closes before user input

    So why continue doing things in key up?
  15. David Heffernan

    Modal dialog closes before user input

    This sounds like you are papering over the problem.
  16. David Heffernan

    Modal dialog closes before user input

    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.
  17. It sounded like you might be accessing an object after it has been destroyed which is obviously incorrect.
  18. David Heffernan

    Modal dialog closes before user input

    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.
  19. 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.
  20. David Heffernan

    Function with 2 return values ?

    It goes from bad to worse!!
  21. David Heffernan

    Function with 2 return values ?

    We don't need any context to know that a fixed length array shouldn't be named a tuple.
  22. David Heffernan

    Function with 2 return values ?

    But it's a tuple too. My question was really for Stefan though.
  23. David Heffernan

    The best way to handle undo and redo.

    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?
×