-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Your biggest advantage here is the fact that you can use strings as case selectors (they are not an ordinal type and so cannot be used in Pascal); otherwise:
CASE animalType OF
'lion', 'tiger': doCaseLionOrTiger;
'koala':
BEGIN
doCaseKoala;
doCaseBear
END;
'bear': doCaseBear;
OTHERWISE doSomethingElse
END;And as for the possibility of doCaseBear being multiple statements long, Pascal does support nested subroutines, which can encapsulate virtually any such condition, and even provide more local variables solely for that block of code. With a good optimizing compiler...
And as for the string issue, animalType could be something like:
TYPE
animalTypes = (lion, tiger, koala, bear);
Oh, and alternatively:
CASE animalType OF
'lion', 'tiger': doCaseLionOrTiger;
'koala', 'bear':
BEGIN
IF animalType = 'koala' THEN doCaseKoala;
doCaseBear
END;
OTHERWISE doSomethingElse
END;So, a 'break' statement approach doesn't add any more capability than Pascal offers (when combined with nested subroutines, at least).
On Mar 4, 2005, at 4:06 PM, Mark Wieder wrote:
Frank-
Friday, March 4, 2005, 10:17:36 AM, you wrote:
FDEJ> I hate C, and all the "break"s that come with it...
Your bad attitude is showing <g>... learn to love the break statement. The fall-through approach allows you to do some things that are not (easily) doable in pascal:
switch animalType case "lion" case "tiger" doCaseLionOrTiger break case "koala" doCaseKoala -- and since koalas are a kind of bear... case "bear" doCaseBear break default doSomethingElse end switch
-- -Mark Wieder [EMAIL PROTECTED]
_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution
- ----------------------------------------------------------- Frank D. Engel, Jr. <[EMAIL PROTECTED]>
$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCKbf17aqtWrR9cZoRAqmSAJ9uVRXjgd7vkw+3JMNDTAd9V/UvFwCfQi2K a0/uRjrQer9jax9Bf2s/Sfw= =fszt -----END PGP SIGNATURE-----
___________________________________________________________ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com
_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution
