View Single Post
  #4  
Old 07-05-2009, 11:30 AM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
The code you posted is wrong, actually. You'd need to do this (you forgot to take that index out of the array):

PHP Code:
temp.saleamount temp.fish[temp.fish.index(fish) + 1]; 
My way is probably more efficient, however, since the engine isn't having to check through the array once to find the index, add one to the index, then loop through the array again to find the other index. However, it'd be such a miniscule difference it would work fine either way.
Oh, you're right haha. How dumb of me =p
Reply With Quote