User:Anaminus/break nutshell: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Anaminus
mNo edit summary
>Anaminus
mNo edit summary
 
Line 1: Line 1:
{{CatUp|User:Anaminus}}
=''''break' in a nutshell.'''=  
=''''break' in a nutshell.'''=  



Latest revision as of 08:09, 12 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.