User:Anaminus/break nutshell

From Legacy Roblox Wiki
Revision as of 08:09, 12 April 2008 by >Anaminus
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

'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.