Browse Prior Art Database

Improved Case Groups

IP.com Disclosure Number: IPCOM000082863D
Original Publication Date: 1975-Feb-01
Included in the Prior Art Database: 2005-Feb-28
Document File: 2 page(s) / 40K

Publishing Venue

IBM

Related People

Allsen, JK: AUTHOR [+3]

Abstract

The Structured Programming CASE group described herein allows (1) mutually exclusive actions based on equal comparison of control variables, and (2) optional specification of a default action when none of the actions under (1) are taken.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 83% of the total text.

Page 1 of 2

Improved Case Groups

The Structured Programming CASE group described herein allows (1) mutually exclusive actions based on equal comparison of control variables, and
(2) optional specification of a default action when none of the actions under (1) are taken.

A CASE group is delimited by a CASE statement and an ENDCASE statement. Within the CASE group are subgroups delimited by SUBCASE statements; also a default action may be specified by a special subgroup delimited by an ELSECASE statement. The formal description (in BNF) of CASE group syntax is as follows: case-grp::= case-stmt subcase-grp... [elsecase-grp] ENDCASE; case-stmt::= [label-list] CASE var-name; subcase-grp::= subcase- stmt statement... subcase-stmt::= SUBCASE var-name; SUBCASE constant;, elsecase-grp::= ELSECASE statement... (where "statement" implies either a single executable statement or a DO group).

Operation of a CASE group is as follows. The variable defined by the CASE statement is compared to each variable defined by a SUBCASE statement in that CASE group. When an equal condition occurs, the statement(s) following the current SUBCASE statement is/are executed. Execution is terminated by a SUBCASE, ELSECASE, or ENDCASE statement. Control then passes to the next statement after the ENDCASE statement. If no equal condition exists for any subcase in the group, then the statement(s) following the ELSECASE statement is/are executed, if an ELSECASE group is present.

Fig. 1 shows a CASE group exampl...