From 05095851346f52c8e918176e8e2abdf0b21de5ec Mon Sep 17 00:00:00 2001 From: dwheeler Date: Fri, 7 Jul 2006 13:36:27 +0000 Subject: Initial import (sloccount 2.26) git-svn-id: svn://svn.code.sf.net/p/sloccount/code/trunk@1 d762cc98-fd17-0410-9a0d-d09172385bc5 --- testcode/conditions.CBL | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 testcode/conditions.CBL (limited to 'testcode/conditions.CBL') 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. + -- cgit v1.2.1