User:Anaminus/break nutshell: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Anaminus
'break' in a nutshell
 
>Anaminus
mNo edit summary
Line 14: Line 14:
'loop' will print in the output. Note that it appears once.  
'loop' will print in the output. Note that it appears once.  


----


==Another example:==  
==Another example:==  

Revision as of 07:08, 6 April 2008

'break' in a nutshell.

'break': ends a 'while' loop or 'repeat' loop.

Example:

while true do 
wait() 
print("loop") 
break 
end

'loop' will print in the output. Note that it appears once.


Another example:

v = 0 
while true do 
wait() 
print("loop") 
v = v + 1 
if v > 3 then 
break 
end 
end 

'loop' will print in the output.

'loop' will print in the output.

'loop' will print in the output.