Re: Can switch be used here?
Re: Can switch be used here?
- Subject: Re: Can switch be used here?
- From: Brad Bumgarner <email@hidden>
- Date: Mon, 24 Jul 2006 11:28:49 -0600
Thanks for the info Chas.
Brad
On Jul 24, 2006, at 11:22 AM, Chas Spillar wrote:
If I remember correctly, a switch statement case must be a compiled
time
integral value. That is, once the compilation is finished the
value of the
case must be known. Thus, what you describe (using a boolean
value) would
not work. If you can map the various boolean cases to match a single
integral value then it can be made to work. However, a laddered
if-then-else would be clearer.
E.g.
If (f==0) {
} else if (l = 0) {
} else if (f > l) {
} else if (f == l) {
} else if (f < l) {
}
Better would be to just subtract the two counts:
f - l
If the value is negative f is smaller than l, if the value is
positive then
f is greater than l, if the value is 0 they are equivalent.
Chas.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden