Scriptol/Scan By
< Scriptol
Scan By
editCommon syntax
editThe 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[]
/scan
The current element is denoted by an empty indice.
Example with two arrays:
scan a, b print a[] + b[] /scan
Scan with a function
editYou 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 return
scan a by fun
If you use several arrays, the number of argument of the function must be the number of array.