aboutsummaryrefslogtreecommitdiff
path: root/examples/local-loop.ph
diff options
context:
space:
mode:
Diffstat (limited to 'examples/local-loop.ph')
-rw-r--r--examples/local-loop.ph12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/local-loop.ph b/examples/local-loop.ph
new file mode 100644
index 0000000..2b7d870
--- /dev/null
+++ b/examples/local-loop.ph
@@ -0,0 +1,12 @@
+procedure SUM{num[int]} return int
+var sum = 0
+var idx = 0
+is
+ do
+ sum = sum + idx,
+ idx = idx + 1
+ until idx = num,
+ return sum
+end procedure
+
+print SUM(1000000001)