summaryrefslogtreecommitdiff
path: root/testcode/conditions.CBL
diff options
context:
space:
mode:
authordwheeler <dwheeler@d762cc98-fd17-0410-9a0d-d09172385bc5>2006-07-07 13:36:27 +0000
committerdwheeler <dwheeler@d762cc98-fd17-0410-9a0d-d09172385bc5>2006-07-07 13:36:27 +0000
commit05095851346f52c8e918176e8e2abdf0b21de5ec (patch)
tree8de964f5eea4c7d80faf34d5d744e215a053ba8f /testcode/conditions.CBL
downloadsloccount-05095851346f52c8e918176e8e2abdf0b21de5ec.tar.gz
Initial import (sloccount 2.26)HEADmaster
git-svn-id: svn://svn.code.sf.net/p/sloccount/code/trunk@1 d762cc98-fd17-0410-9a0d-d09172385bc5
Diffstat (limited to 'testcode/conditions.CBL')
-rw-r--r--testcode/conditions.CBL31
1 files changed, 31 insertions, 0 deletions
diff --git a/testcode/conditions.CBL b/testcode/conditions.CBL
new file mode 100644
index 0000000..8e12724
--- /dev/null
+++ b/testcode/conditions.CBL
@@ -0,0 +1,31 @@
+ $ SET SOURCEFORMAT"FREE"
+IDENTIFICATION DIVISION.
+PROGRAM-ID. Conditions.
+AUTHOR. Michael Coughlan.
+* An example program demonstrating the use of
+* condition names (level 88's).
+* The EVALUATE and PERFORM verbs are also used.
+
+DATA DIVISION.
+WORKING-STORAGE SECTION.
+01 Char PIC X.
+ 88 Vowel VALUE "a", "e", "i", "o", "u".
+ 88 Consonant VALUE "b", "c", "d", "f", "g", "h"
+ "j" THRU "n", "p" THRU "t", "v" THRU "z".
+ 88 Digit VALUE "0" THRU "9".
+ 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9".
+
+PROCEDURE DIVISION.
+Begin.
+ DISPLAY "Enter lower case character or digit. No data ends.".
+ ACCEPT Char.
+ PERFORM UNTIL NOT ValidCharacter
+ EVALUATE TRUE
+ WHEN Vowel DISPLAY "The letter " Char " is a vowel."
+ WHEN Consonant DISPLAY "The letter " Char " is a consonant."
+ WHEN Digit DISPLAY Char " is a digit."
+ WHEN OTHER DISPLAY "problems found"
+ END-EVALUATE
+ END-PERFORM
+ STOP RUN.
+