Difference between revisions of "Expressions"
From Wiki
(→expressions) |
|||
| Line 1: | Line 1: | ||
| − | = | + | ==Expressions== |
Expressions are important building blocks in an EasyUO script. They can be used to create relatively advanced integer mathematics. | Expressions are important building blocks in an EasyUO script. They can be used to create relatively advanced integer mathematics. | ||
| Line 15: | Line 15: | ||
<pre>This whole chapter need to be clarified in order to distingish Satements from Expressions. | <pre>This whole chapter need to be clarified in order to distingish Satements from Expressions. | ||
| − | + | ==Statements== | |
An EasyUO script is a sequence of statements. A statement is any of the following: | An EasyUO script is a sequence of statements. A statement is any of the following: | ||
| Line 29: | Line 29: | ||
A block is a sequence of statements grouped within brackets. Opening and closing brackets MUST occurs on a distinct line (Hence one could argue that both "{" and "}" are statements by themself). Blocks are almost excusively used in conjuntion with control structures. | A block is a sequence of statements grouped within brackets. Opening and closing brackets MUST occurs on a distinct line (Hence one could argue that both "{" and "}" are statements by themself). Blocks are almost excusively used in conjuntion with control structures. | ||
| − | Example | + | ==Example== |
{ | { | ||
set %var 2 + 2 | set %var 2 + 2 | ||
Revision as of 12:18, 18 August 2005
Expressions
Expressions are important building blocks in an EasyUO script. They can be used to create relatively advanced integer mathematics.
An expression can be a simple constant value or it can be a more advanced mathematical expression.
set %var 2 + 2
User Contributed Notes
/docs/expressions.php
the.WZA@easyuo.com
30-Jun-2005 14:32
This whole chapter need to be clarified in order to distingish Satements from Expressions.
==Statements==
An EasyUO script is a sequence of statements. A statement is any of the following:
- a command
- a block
- a control structure
A command typically takes the form: <command_name> <parameters>
Example:
set %var 2 + 2
A block is a sequence of statements grouped within brackets. Opening and closing brackets MUST occurs on a distinct line (Hence one could argue that both "{" and "}" are statements by themself). Blocks are almost excusively used in conjuntion with control structures.
==Example==
{
set %var 2 + 2
display ok %var
}
Control structure are defined individually elsewhere in the documentation.
EXPRESSIONS:
An expresion is any of the following:
- a literal
- a variable
- an expresion enclosed with parenthesis
- an unary operator followed by an expression
- an expression followed by a binary operator and an expression
Examples:
1337 ; literal numeric value
cheffe ; literal string value
%var
! #true ; unary operator
%var + 1 ; binary operator
( 2 + 2 ) * ( 3 - 1 ) ; parenthesis enclosed expressions
| Main_Page | Documentation |