Passing parameters

Parameters can be passed within different brackets and will then be processed different ways:

-value of parameter is calculated every time it is referred to from within the method
-value of parameter is processed only once-before the method is called
-value of parameter is processed every time it is referred to from within the method

An example to demonstrate difference between brackets:
<hr />

<br />]

As you can see, in the first case the code was calculated only once-before method
sum was called-and the method received the result of this calculation-number 30. In the second case the code was executed every time the parameter was referred to-that is why the result was different each time, depending on the counter's value.

There can be many parameters or none. If you place many parameters inside single-type brackets, they can be separated by semicolon. Any combination of different types of parameters is allowed.

For example, the construction...
    ^if(condition){when true;when false} equal to...
    ^if(condition){when true}{when false}

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 04.09.2009