Scriptol/Scan By

Scan ByEdit

Common syntaxEdit

The scan control structure allows to parse one or several arrays, and to apply a process onto each element of the array(s).

scan a

a[] * a[] 
print a[] 


The current element is denoted by an empty indice.

Example with two arrays:

scan a, b
 print a[] + b[] 

Scan with a functionEdit

You can apply instead a predefined function. The argument of the function is an element of the array.

array a = {1,2,3,4 } 
void fun(number x) 
 print x * x
scan a by fun 

If you use several arrays, the number of argument of the function must be the number of array.