Skip to content

Syntax flow control

irxground edited this page Sep 28, 2012 · 7 revisions

関数呼び出し

Proc << Arg1 Arg2 >> Out1 Out2

If文

案A.

IF cond1 Then
  proc1
ElseIf cond2 Then
  proc2
Else
  proc3
End If

案B.

Fork
IF cond1 Then
  proc1
If cond2 Then
  proc2
Else
  proc3
Join

While文

案A

Set: 0 0 -> i sum
While i <= 100 Do
    Add: i => sum
    Inc: => i
End While

案B

Set: 0 -> sum
Set: 0 -> i
Loop While i <= 100 Do
    Add: i -> sum
    Inc: i
Next

For文

Set: 0 -> sum
For $data.ChildItems -> item
    ParseInt: item.Value -> val
    Add: val >-> sum
End For
Say: sum
__XML__
<data>
  <item>1</item>
  <item>2</item>
  <item>3</item>
  <item>4</item>
  <item>5</item>
</data>