继续在lua

代码示例

3
0

继续在lua

-- Lua has no continue statement because it's designed to
-- be lightweight. Use goto instead:

arr = {1, 2, 3, 5, 6, 7, 8}

for key, val in ipairs(arr) do
  if val > 6 then
     goto skip_to_next
  end
  -- perform some calculation
  
  ::skip_to_next::
end

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................