Curl Global Community

Full Version: Page 7: Summary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
TRY 2 Overview

Event handler structure



on

Code:
{on event-type do body}
{on event-type at target-var[:target-type] do body}
{on event-var:event-type at target-var[:target-type] do body}

where
  • event-var:event-type: binds a variable to the event.
  • target-var[:target-type]: binds a variable to the target.
  • body is the code for the event handler procedure.



Branching expressions



if

Code:
{if condition-1 then
    code-block-1
elseif condition-2 then
    code-block-2
elseif condition-3 then
    code-block-3
    ...
elseif condition-n then
    code-block-n
[else
     code-block-n+1]
}

where
  • condition-1, condition-2, ...: are Boolean expressions.
  • code-block-1, code-block-2, ...: each consist of one or more Curl language expressions.



switch

The switch expression has the following syntax:

Code:
{switch compare-expr [using compare-operator]
     case value-1 do
        code-block-1
     case value-2 do
        code-block-2
        ...
     case value-n do
        code-block-n
        [else code-block-n+1]
    }


where
  • compare-expr, value-1, value-2, value-n: are Curl language expressions. These expressions can evaluate to any Curl language type.
  • compare-operator: the operator that the Curl language uses when comparing compare-expr to value-1, value-2, and so on.
  • code-block-1, code-block-2, code-block-n: consist of one or more Curl language expressions.



Types of graphical containers