mjau Posted February 23, 2012 Posted February 23, 2012 Ok im just wondering what is break for in lua ?
TAPL Posted February 23, 2012 Posted February 23, 2012 break is for stop-finish-end loop http://www.lua.org/pil/4.4.html
mjau Posted February 23, 2012 Author Posted February 23, 2012 yeah kenix the operator and tapl i saw that but didnt understand what its useful for
Kenix Posted February 23, 2012 Posted February 23, 2012 t = { 'next'; 'some'; 'etc'; } for i,v in pairs( t ) do if v == 'some' then print ( i,'v == some' ) break end end print 'done' -- some code Output: 2,v == some done I think you understand. You can test this example in lua demo. http://www.lua.org/cgi-bin/demo
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now