Just a fun discovery, I didn't know/remember that spaces are valid between "." and fields:

Just a fun discovery, I didn't know/remember that spaces are valid between "." and fields:

Button1.             Caption := 'Hello';

Comments

  1. Even more ,this one is still valid !
    //------------------------
    Button1
    .
    Caption
    :=
    'Hello'
    ;
    //----------------------

    ReplyDelete
  2. whitespace(space, tabs, line breaks) is usually ignored

    ReplyDelete
  3. I leaverage this when writing unit tests with Mocks.

    fComponent.Setup
      .WillExecute
      .Once
      .WhenCalling
      .Click();

    ReplyDelete
  4. Great way to mess up a maintenance team.

    ReplyDelete
  5. That feature of the parser is the only thing that makes Fluent interfaces sane.

    ReplyDelete
  6. How about:

    with button. do
    begin
    caption := "Hello";
    width := 125;
    height := 24;
    end;

    ;-)

    ReplyDelete
  7. "Yeah... but you can't do that."
    "Why not?"
    "Because it's freakin' me out."
    https://www.youtube.com/watch?v=vVX-PrBRtTY

    ReplyDelete
  8. Thanks for the tip. Never tried it, but it sounds quite plausible from a parsers point of view. Now mixing this with RightToLeft-Override and some more strange unicode stuff...oh i can hear them scream XD

    ReplyDelete

Post a Comment