Re: Annoying warning: statement with no effect
Re: Annoying warning: statement with no effect
- Subject: Re: Annoying warning: statement with no effect
- From: Andreas Mayer <email@hidden>
- Date: Mon, 11 Nov 2002 21:15:32 +0100
Am Montag, 11.11.02 um 20:39 Uhr schrieb Jonathan Jackel:
for (r = [addRowsField intValue]; r--; r == 0)
Maybe using
for (r = [addRowsField intValue]; r == 0; r--)
would help?
This statement works exactly as you would expect. The variable r
starts
with the number in a field, decrements with each loop, and stops when r
reaches zero.
Well, I suppose that's just a coincidence. The loop stops when the
second expression evaluates to zero. Since you are testing for zero
anyways, it works all the same in this case. You could probably also
write:
for (r = [addRowsField intValue]; r--;)
Someone please correct me, if I'm wrong.
bye. Andreas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.