flexible indents

Is it possible to have a variable indent in the generated code???

{_indent}object lblLabel: TLabel
{_indent}  Top = 0
{_indent}  Left = 10

And that that would result in something like this (with _indent set to 4 spaces):

    object lblLabel: TLabel
      Top = 0
      Left = 10

I was hoping this would work: [SETALIAS]_indent[TO]____
(Where _ is a space, so I hoped _indent would be 4 spaces)
But unfortunately it didn’t…
It appears that the engine trims trailing spaces, which is kinda logical.
So, what I did is the following:

 [SETALIAS]_indent[TO]    {_endindent}

That way, the engine knows when to ‘end’ the text for the alias.

Leave a Reply

Your email address will not be published. Required fields are marked *