lua-users home
lua-l archive

Re: tables problem

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


--- Mike Atamas wrote:
> I changed it and got things to work. Here is what the function
> looks like now:
A couple suggestions: make 'a' local and don't bother checking
remaining array elements after you've found the one you're
looking for:
 
function dep:remove( _name )
 local a ---> ADDED
 for i = 1, table.getn(self.deps)
 do
 if self.deps[i]["name"] == _name
 then
 a = i
 break ---> ADDED
 end
 end
 table.remove(self.deps,a)
end
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

AltStyle によって変換されたページ (->オリジナル) /