mjau Posted February 23, 2012 Share Posted February 23, 2012 Ok im just wondering what is break for in lua ? Link to comment
Kenix Posted February 23, 2012 Share Posted February 23, 2012 What you mean? Operator break? Link to comment
TAPL Posted February 23, 2012 Share Posted February 23, 2012 break is for stop-finish-end loop http://www.lua.org/pil/4.4.html Link to comment
mjau Posted February 23, 2012 Author Share Posted February 23, 2012 yeah kenix the operator and tapl i saw that but didnt understand what its useful for Link to comment
Kenix Posted February 23, 2012 Share 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 Link to comment
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