Printing Crashes Rev in OSX
Frank D. Engel, Jr.
fde101 at fjrhome.net
Wed Feb 2 18:23:26 CST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Alas, the rather stupid syntax introduced by C (or some older language)
and quickly adopted by the masses! Stupid nevertheless.
In C, Transcript, etc. - once you match a single 'case', any future
'case' items are ignored. 'break' gets you out. This is because C,
etc. limit you to *one* matching item per 'case'; in essence:
case 1: do this; break;
case 2: do this; break;
what if you want the same code to execute for both 3 and 4? In
C/Transcript, you can't do this:
case 3, 4: do this; break;
so you do this instead:
case 4: do this; break;
and the 'case 4' is ignored if the '3' matches, allowing for multiple
matching cases like this. Pascal, Ada, etc. have the superior syntax;
in Ada for example:
case whatever is
when 1 ==> do this;
when 2 ==> do this;
when 3 | 4 ==> do this;
when others ==> do this;
No messy 'break' statements to deal with, and it is still rather
readable. You can do ranges, too, like
when 4..7 ==> do this;
Pascal's syntax looks slightly different, but is similar:
case whatever of
1: do this;
2: do this;
3, 4: do this;
On Feb 2, 2005, at 6:17 PM, Sivakatirswami wrote:
> Dan, Indeed, one would expect the drop-through if there is no "break"
> but, how would
> case "Quit"
> evaluate to "true" when the parameter
> passed from the menuPick was "Print"
> That's what is mysterious.
> On Feb 1, 2005, at 6:38 PM, Dan Shafer wrote:
>> Actually, the drop-through is exactly what I'd expect. ;-) Otherwise,
>> how would you execute more than one case in a switch statement?
>> On Feb 1, 2005, at 8:09 PM, Sivakatirswami wrote:
>>> one would not expect the switch to dropdown to "quit" since quit
>>> was not chosen, but that appears to be what happened.
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
> use-revolution mailing list
> use-revolution at lists.runrev.com
Frank D. Engel, Jr. <fde101 at fjrhome.net>
$ 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
-----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
More information about the use-livecode