Table 2.15. Tests
| type | description | example |
|---|---|---|
| A || B | OR between command | if (A || B) {}; |
| A && B | AND between command | if (A && B) {}; |
| A =~= B | return 1 if A is env equal to B, need delta property (A->delta and B->delta) | if (A =~= B) {}; |
| A == 3 ~ 5s | return 1 if A equal 3 during 5s mini | if (A == 3 ~ 5s) {}; |
| == | test an equality, useful for if test | 1== 2; return 0, 1== 1; return 1 |
| != | test a non equality, useful for if test | 1!= 2; return 1, 3!= 3; return 0 |
| > | test a sup, useful for if test | 1 > 2; return 0, 3 > 2; return 1 |
| >= | test a sup or equal, useful for if test | 1 >= 2; return 0, 3 >= 3; return 1 |
| < | test a inf, useful for if test | 1 < 2; return 1, 3 < 3; return 0 |
| <= | test a inf or equal, useful for if test | 1 <= 2; return 1, 3 <= 3; return 1 |
isxxxx() function enable to test type of an UVar.
Table 2.16. isxxxx();
| command | description |
|---|---|
| isunknown(); | |
| isnum(); | |
| isstring(); | |
| isbinary(); | |
| isimage(); | |
| issound(); | |
| isvoid(); | test if uvar is void or not : return 1 if void, 0 if value is valid |
| islist(); | |
| isobject(); | |
| isfunction(); | |
| isdef(myUVar); | return 1 if myUVar is defined, 0 else |
| isfile(); | |
| isvariable(); |
Table 2.17. Control and Loops
| command | description | note |
|---|---|---|
| if(test){ ... } else{ ... }; | if structure | see tests table for "test" examples |
| while(test){ ... }; | while structure | |
| while |(test){ ... }; | while| structure | pipe all instructions in ONE cycle, quicker |
| for (i=0 ; i< 5 ; i++){ ... }; | for structure | |
| for |(i=0 ; i< 5 ; i++){ ... }; | for| structure | pipe all instructions in ONE cycle, quicker |
| for &(i=0 ; i< 5 ; i++){ ... }; | for& structure | launch all the command in parallele, as a & between all of them |
| loop{ ... }; | loop structure | infinite loop of instructions |
| loopn(10){ ... }; | loopn structure | finite loop of 10 iterations in this case |
| loopn & (10){ ... }; | loopn & structure | finite loop of 10 iterations in this case, anded |
| loopn | (10){ ... }; | loopn | structure | finite loop of 10 iterations in this case, piped |