Full Form

Full Form

Thus far we have been using the short form to declare our controls. The short form consists of:

<control tag> <parameter>

From our previous example:

ACORN 1.0 IWML 1.0
Page[]
  SimpleStack[]
    Text Hello
    Text World
    Button Ok
  ]
]

No Parameters

Each of our controls has a parameter. Sometimes though it is desirable to declare a control with no properties and no parameters. This is common with the EOL tag. Here we will demonstrate the syntax to use when there are no parameters while retaining the short form with our Button to show the difference and also because the Button will remain visible when shown even without a parameter.

ACORN 1.0 IWML 1.0
Page[]
  SimpleStack[]
    Text Hello
    Text World
    Button;
  ]
]

Note the ; (semi-colon) at the end of Button. This signifies that the control declaration is using the short form, but has no parameters. Use of the short form greatly increases both readability of IWML, but make hand writing IWML much more convenient.

Full Form

The previous example can also be written in full form. The short form allows us to keep things compact and removes the need to use the longer full form for every control declaration.

ACORN 1.0 IWML 1.0
Page[]
  SimpleStack[]
    Text Hello
    Text World
    Button
    ]
  ]
]

This is a full form declaration for Button but its empty. Now that we have the full form syntax though, we can set properties other than those accessible by the parameter. This also means that the former parameter we had must be listed as a property. In this case, Button’s parameter maps to the .Text property, so we set it explicitly and add other properties as well.

Block Start

When a control declaration has no parameters, and has no semi-colon it opens a block. In our example, Button now has a block of its own and an additional ] was added to close the block.

Properties

Properties are set according to this syntax:

<property name>: <value>

The separator between property name is : (colon) followed by a space. The property value is terminated by end of line. This syntax reduces and nearly eliminates the need to escape any values except in the case of markdown.

ACORN 1.0 IWML 1.0
Page[]
  SimpleStack[]
    Text Hello
    Text World
    Button
      Text: Ok
      Width: 200
      TextHAlign: Right
    ]
  ]
]

Try It