• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Annoying warning: statement with no effect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Annoying warning: statement with no effect (From: Jonathan Jackel <email@hidden>)

  • Prev by Date: Re: Annoying warning: statement with no effect
  • Next by Date: Re: Annoying warning: statement with no effect
  • Previous by thread: Connection warning icons?
  • Next by thread: Re: Annoying warning: statement with no effect
  • Index(es):
    • Date
    • Thread