Jump to content

Ondrej Kelle

Members
  • Content Count

    83
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ondrej Kelle


  1. 1 minute ago, Remy Lebeau said:

    A declaration of an alias, anyway.  TMyClass and TAnotherClass will be the same type, as far as the compiler and RTTI are concerned.  Now, if you do this instead:

    
    TMyClass = type TAnotherClass; 

    Or this:

    
     TMyClass = class(TAnotherClass)

    Then TMyClass will be its own unique type.

    Thanks! I think you're completely right and off-topic to the question. 🙂


  2. Simple assignment to Content should be sufficient:

    Response.Content := doc.XML.Text;

    This will both encode the incoming string value and set ContentLength automatically. (See TISAPIResponse.SetContent in Web.Win.IsapiHTTP.)

    In your case the encoded stream was longer than the original text, e.g. due to insertion of escape characters. By setting ContentLength explicitly you have effectively truncated the encoded stream.

    • Like 1

  3. 1 hour ago, David Hoyle said:

    Actually I disagree, sorry.

    I apologise, no flame intended 🙂 Was that a reply to me? It's not terribly important - but do you disagree with the fact that the code was posted in 2009? 🙂

    Just curious. I wish you a nice Sunday. 🙂


  4. 13 minutes ago, Lars Fosdal said:

    Just curious: Has anyone seen a valid use case for defined ordinal values in enumerations?

    Not really when writing my own code, I try to avoid them if possible.

    Sometimes for interop with an API, e.g. when translating C headers where enums are already declared that way.

    Or when you need to support a binary format which uses some specific ordinal values, then it depends - you might still prefer to use an enum but avoid conversion.


  5. 21 hours ago, Sherlock said:

    On a totally unrelated matter I would like to direct your attention to a completely underrated feature of Delphi: LiveBlame - in the IDE!

    1912315494_Screenshot2019-02-01um13_55_45.png.b2f469d36bf60fe4e5ebc68fe0bdc511.png

     

    This however works with hg,git and Subversion. But I just love this! I love to put blame on others, and then find out it was my fault after all! 😄

     

     

    People have actually asked for blame as a feature, that's why I included it back then in delphisvn (before it became Version Insight).

    I find it useful myself to see who committed which lines and also when. This piece of metadata can be useful when trying to understand a code base and its evolution.

     

    • Like 1
    • Thanks 2

  6. 1 hour ago, Tommi Prami said:

    Thanks,

     

    I see nothing wrong in that, but I just can't see why Compiler does not like it. It might be something trivial, but I just can't figure it out.

     

    TMenuBarInfo = tagMENUBARINFO; // <- [dcc32 Error] : E2029 '=' expected but identifier 'TMenuBarInfo' found

     

     

    Sorry, I've been vague. Here's the full code which works in Delphi XE, I hope it helps:

    GetWindowMenuItemRect example

    Cheers!

    • Like 1
×