unexist.dev

Changeset 309:b0001284c72f

Updated test program
author unexist
date Thu, 26 Jan 2012 13:14:09 +0100
parents 02da21c960a0
children f9e2ee86674c
files studies/cmp/test.txt
diffstat 1 files changed, 36 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/studies/cmp/test.txt	Thu Jan 26 13:13:57 2012 +0100
+++ b/studies/cmp/test.txt	Thu Jan 26 13:14:09 2012 +0100
@@ -1,27 +1,57 @@
 program
   procedure P1
     parameter
+      i integer in
     declaration
-      hw string
 
-    set hw "HELLO WORLD"
-
-    print hw
+    print i
 
   procedure P2
     parameter
+      i integer in
+    declaration
+
+    print i
+
+    call P1(i)
+
+  procedure P3
+    parameter
+      s string inout
+    declaration
+
+    input "String: " s
+
+  procedure P4
+    parameter
     declaration
       i integer
+      s string
 
     set i 0
+    set s "out"
 
     # Dummy loop
     loop
       add i 1
 
-      print i
+      case
+        when equal i 2
+          print s
+
+        when equal i 5
+          call P2(i)
 
-      case
+        when equal i 6
+          loop
+            add i 1
+
+            case
+              when equal i 8
+                exitloop
+              otherwise
+                print i
+
         when greater i 10
           exitloop