我正在编写一些代码,我正在尝试修改所述循环内循环的结束整数(如标题中所述)
所以它看起来像这样
dim x as integer
For i=0 to x
if (some conditions) then
x=x+1
End if
Next
但是它似乎不起作用,看起来循环正在使用 x 的静态值而不是动态值。
是否有一种方法可以更新循环的结束整数,而无需使用 exit for
并重新启动循环?
谢谢
最佳答案
您可以使用 While 循环。
dim x as integer
Dim i as Integer = 0
While i <= x
if (some conditions) then
x=x+1
End if
End While
关于vb.net - 更改循环内循环的结束整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56812961/