Tests and loop

Table 2.15. Tests

typedescriptionexample
A || BOR between commandif (A || B) {};
A && BAND between commandif (A && B) {};
A =~= Breturn 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 miniif (A == 3 ~ 5s) {};
==test an equality, useful for if test1== 2; return 0, 1== 1; return 1
!=test a non equality, useful for if test1!= 2; return 1, 3!= 3; return 0
>test a sup, useful for if test1 > 2; return 0, 3 > 2; return 1
>=test a sup or equal, useful for if test1 >= 2; return 0, 3 >= 3; return 1
<test a inf, useful for if test1 < 2; return 1, 3 < 3; return 0
<=test a inf or equal, useful for if test1 <= 2; return 1, 3 <= 3; return 1

isxxxx() function enable to test type of an UVar.

Table 2.16. isxxxx();

commanddescription
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

commanddescriptionnote
if(test){ ... } else{ ... };if structuresee tests table for "test" examples
while(test){ ... };while structure 
while |(test){ ... };while| structurepipe all instructions in ONE cycle, quicker
for (i=0 ; i< 5 ; i++){ ... };for structure 
for |(i=0 ; i< 5 ; i++){ ... };for| structurepipe all instructions in ONE cycle, quicker
for &(i=0 ; i< 5 ; i++){ ... };for& structurelaunch all the command in parallele, as a & between all of them
loop{ ... };loop structureinfinite loop of instructions
loopn(10){ ... };loopn structurefinite loop of 10 iterations in this case
loopn & (10){ ... };loopn & structurefinite loop of 10 iterations in this case, anded
loopn | (10){ ... };loopn | structurefinite loop of 10 iterations in this case, piped