diff options
Diffstat (limited to 'tests/ii/files/program.cps')
| -rw-r--r-- | tests/ii/files/program.cps | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ii/files/program.cps b/tests/ii/files/program.cps new file mode 100644 index 0000000..9bc4aad --- /dev/null +++ b/tests/ii/files/program.cps @@ -0,0 +1,29 @@ +DECLARE Count : INTEGER +DECLARE Index : INTEGER +DECLARE Text : STRING +DECLARE Extra : STRING +DECLARE Line : STRING +DECLARE Combined : STRING +DECLARE Lines : INTEGER +INPUT Count +FOR Index <- 1 TO Count + INPUT Text + INPUT Extra + OPENFILE "roundtrip.txt" FOR WRITE + WRITEFILE "roundtrip.txt", Text + WRITEFILE "roundtrip.txt", "" + CLOSEFILE "roundtrip.txt" + OPENFILE "roundtrip.txt" FOR APPEND + WRITEFILE "roundtrip.txt", Extra + CLOSEFILE "roundtrip.txt" + OPENFILE "roundtrip.txt" FOR READ + Combined <- "" + Lines <- 0 + WHILE NOT EOF("roundtrip.txt") DO + READFILE "roundtrip.txt", Line + Combined <- Combined & "[" & Line & "]" + Lines <- Lines + 1 + ENDWHILE + CLOSEFILE "roundtrip.txt" + OUTPUT Lines, ":", Combined +NEXT Index |
