Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 14167, Cenon Del Rosario

by A. Anonymous Email: Anonymous


Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 1.0  to 1.0 13 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Wed, 22 Dec 1999 00:00:00 GMT
Originally uploaded on Wed, 22 Dec 1999 00:00:00 GMT
Description
I wanted to propose that a new CASE statement be included. This is based on a mainframe language I used called Natural (by Software AG). Anyway, here is how it works:

Case [FIRST, EVERY]
conditional expression 1:
Statements...
conditional expression 2:
Statements...
conditional expression 3:
Statements...
.
.
.
ANY:
Statements...
NONE:
Statements...
End Case

If you look at this, it basically eliminates the IF ELSE statement and make code very easy to read.

Notes:
- The FIRST keyword means that only statements related to the FIRST TRUE conditional expression get executed. No other conditional expressions are evaluated as soon as the first TRUE one is met.
- The EVERY keyword means that only statements related to the TRUE conditional expressions get executed. All conditional expressions are evaluated and TRUE ones have their related statements executed.
- The ANY condition means that its related statements are executed whenever a conditional expression is TRUE.
- The NONE condition means that its related statements are executed when no conditions are TRUE.
- You could also consider using the same syntax for Object Pascal's existing CASE statement. Natural does have this and works the same but works on "values" rather than conditions.

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03