vb.net - 在vb.net中,当你跳出循环时,你会打破所有的嵌套循环吗?

标签 vb.net loops

所以我有一些 vb.net 代码,并且在 For 循环内有一个嵌套的 For 循环,然后有 EXIT FOR 语句,它会跳出一个循环还是整个链?

最佳答案

Exit For只会退出当前正在执行的 For 循环。

来自MSDN :

Exit For

Immediately exits the For loop in which it appears. Execution continues with the statement following the Next statement. Exit For can be used only inside a For...Next or For Each...Next loop. When used within nested For loops, Exit For exits the innermost loop and transfers control to the next higher level of nesting.

关于vb.net - 在vb.net中,当你跳出循环时,你会打破所有的嵌套循环吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10552433/

相关文章:

asp.net-mvc - 如何在区域中使用公共(public) _ViewStart?

.net - RSA:如何根据密码生成 RSA 公钥和私钥 (.net)

java - 如何遍历字节数组列表...?

java - 如何在没有迭代器的情况下迭代 Set/HashSet?

javascript - 叠瓦循环+超时有时会失败

vb.Net时间跨度计算

vb.net - 需要帮助将 Vb.Net 转换为 Delphi (API Stuff (?))

vb.net - 如何解决 Windows 窗体设计器问题 - 控件继续调试?

javascript - 查找 JSON 数组对 Angular 中的特定键具有特定值

c++ - 如何替换 C++ 循环中的旧值?