aboutsummaryrefslogtreecommitdiff
path: root/tests/ii/files/program.cps
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ii/files/program.cps')
-rw-r--r--tests/ii/files/program.cps11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/ii/files/program.cps b/tests/ii/files/program.cps
index f825118..a9f22c0 100644
--- a/tests/ii/files/program.cps
+++ b/tests/ii/files/program.cps
@@ -3,12 +3,19 @@ DECLARE Index : INTEGER
DECLARE Text : STRING
DECLARE Extra : STRING
DECLARE Line : STRING
+DECLARE Pair : STRING
+DECLARE Cut : INTEGER
DECLARE Combined : STRING
DECLARE Lines : INTEGER
INPUT Count
FOR Index <- 1 TO Count
- INPUT Text
- INPUT Extra
+ INPUT Pair
+ Cut <- 1
+ WHILE MID(Pair, Cut, 1) <> " "
+ Cut <- Cut + 1
+ ENDWHILE
+ Text <- LEFT(Pair, Cut - 1)
+ Extra <- RIGHT(Pair, LENGTH(Pair) - Cut)
OPENFILE "roundtrip.txt" FOR WRITE
WRITEFILE "roundtrip.txt", Text
WRITEFILE "roundtrip.txt", ""