Scriptol/For In
外觀
< Scriptol
標準語法使用範圍內的元素為變數賦值,Scriptol 使用常見的寫法,在兩個值(或變數)之間使用雙點來表示範圍。
for int x in 0 .. 10 print x /for
如果結構體的主體只有一個語句,則使用簡化的語法。
for int x in 0 .. 10 print x
for 控制結構可以像上面那樣掃描一個整數,也可以掃描一個文字或一個數組。
text hello = "hello" for text t in hello print t
array a = { 1, 2, 3 }
for dyn x in a print x