This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
trainingtutorial:create_code [2009/12/22 14:42] shona.weldon |
trainingtutorial:create_code [2009/12/22 15:11] shona.weldon |
||
---|---|---|---|
Line 2: | Line 2: | ||
The obvious way to create code is to just type it in but there are also some features in the [[trainingtutorial:documenter_tour#procedure editor dialogue]] that will help. | The obvious way to create code is to just type it in but there are also some features in the [[trainingtutorial:documenter_tour#procedure editor dialogue]] that will help. | ||
+ | |||
+ | For lots of tips on tool coding see: [[https://www.whatiftechnologies.com/doku.php?id=how_tos|How Tos]] | ||
===== Clicking in variable and informant names ===== | ===== Clicking in variable and informant names ===== | ||
Line 22: | Line 24: | ||
===== Parser Important Information and Limitations ===== | ===== Parser Important Information and Limitations ===== | ||
- | - The parser reads and executes left to right ALWAYS, it does not obey regular math ordering - BEDMAS (brackets, exponents, division, multiplication, addition, subtraction) | + | * The parser reads and executes left to right ALWAYS, it does not obey regular math ordering - BEDMAS (brackets, exponents, division, multiplication, addition, subtraction) |
- | - Multiplication is NOT "Matrix" multiplication it is cell by cell multiplication with matching of the indicies. When there is a dimension in | + | * Multiplication is NOT "Matrix" multiplication it is cell by cell multiplication with matching of the indicies. When there is a dimension in |
+ | * Nesting of tool calls works to any depth, however, it can only be done for the left most inputs of the inputs for example: | ||
+ | **Example 1** Nesting: | ||
+ | * This works (because the sum is the first input to the booleq tool): | ||
+ | <code>A[] = booleq (sum (B[x]; dim=xName), 0) </code> | ||
+ | * but this does not (because the sum is now the second input to the booleq tool) | ||
+ | <code>A[] = booleq (0, sum (B[x]; dim=xName)) </code> | ||
+ | **Example 2** Nesting with infix | ||
+ | * Similarly for infix calling of tools, this works (because the sum is the first input to the "+" tool): | ||
+ | <code>A[] = sum (B[x]; dim=xName) + 1 </code> | ||
+ | * but this does not (because the sum is now the second input to the "+" tool) | ||
+ | <code>A[] =1 + sum (B[x]; dim=xName) </code> | ||