What's the piece of Delphi knowledge you find yourself looking up over and over again?

What's the piece of Delphi knowledge you find yourself looking up over and over again?

For me format strings is probably the thing that most stubbornly refuses to stay put in my brain.
http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SysUtils.Format

Comments

  1. Oops didn't mean to disable comments. Please comment away!

    ReplyDelete
  2. Maybe regular expression? But it's not Delphi only.

    ReplyDelete
  3. My favorite example is from the REST unit....

    "TRESTRequestParameterKind.pkGETorPOST"

    Who the bloody heck is going to remember that? Who named it? Must have been a native German speaker. ;-)

    ReplyDelete
  4. Joseph Mitzen This is good name imho. But see on this: github.com - org.aspectj

    ReplyDelete
  5. I use the GExperts Code Librarian to remember how to style DevExpress cxGrid colours for different cells or rows. Must have looked it up dozens if not hundreds of times.

    ReplyDelete
  6. Jacek Laskowski That's a very funny class name! If we're talking about Java, here's one of the longest and poorest I know of:

    github.com - jdk16045

    ReplyDelete
  7. File extension handling. Is the dot required/present or not.

    Most things about generics.

    ReplyDelete
  8. Jeroen Wiert Pluimers Same here! :)

    ReplyDelete
  9. type
    MyRec = record
    a: integer;
    b: string;
    end;

    const
    MyRecArray : array[0..10] of MyRec = ( ??????? )

    Since I do not declare const arrays of records every day , every time I have to declare them I have to look up the syntax.
    Out of your head, in the above example, do you know how to declare the const array ?

    ReplyDelete
  10. Which features were added in which delphi versions, and the corresponding value of {$if compilerversion ...}

    ReplyDelete
  11. Markus Joos One of those many places where a consistent syntax would have helped because this has at least 3 big WATs:

    1. const arrays have values between parentheses instead of square brackets like usually the case for array syntax
    2. const record values have identifier and value separated with a colon instead of equal sign like for all other const declarations
    3. const record values are separated with a semicolon rather than a comma as usual

    But wait there is more - now that we have "const" dynamic array declaration like this:

    const
    nums: array of Integer = [1, 2, 3];

    we also have that for records, right? No! Since that does not compile (see https://quality.embarcadero.com/browse/RSP-19816):

    const
    MyRecs: array of MyRec = [(a:1;b:'foo')];

    Now tell me how awesome Delphi is... consistency wise the syntax is a frankensteins monster.

    ReplyDelete
  12. Stefan Glienke Even worse - the typed const isn't even a const.

    ReplyDelete
  13. The way to set as much digits as I want (no more, no less) while formating reals using FloatToStr, FormatFloat, FlaotToStrF...

    ReplyDelete

Post a Comment