Scriptol/For In

For InEdit

Common syntaxEdit

The standard syntax assigns a variable with the elements of a range, and Scriptol writes a range as it is commonly written, with a double dot between two values (or variables).


for int x in 0 .. 10
  print x
/for 


One-line syntaxEdit

If the body of the structure is only one statement, a simplified syntax is used.

for int x in 0 .. 10 print x 


For in listEdit

The for control structure may scan an interal as above, but also a text or an array.

text hello = "hello"
for text t in hello print t 


array a = { 1, 2, 3 }
for dyn x in a print x