用于循环迭代扩展 [英] For loop iteration extension
本文介绍了用于循环迭代扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找类似下面的for循环
dim i as integer
dim j as integer = 5
对于 i = 0 至 j
如果 i = 5 那么
i = 10
j = 20
结束 如果
下一步
如果i = 5那么我想将i增加到10并且j增加到20,这样循环将扩展到10到20
任何人都可以建议我如何acc optlish this。
解决方案
我想这会有所帮助
< span class =code-keyword> Dim i 作为 整数
< span class =code-keyword> Dim j 作为 整数 = 5
Dim k As 整数
NextLoop:
对于 i = k 至 j
如果 i = 5 然后
k = 10
j = 20
GoTo NextLoop
结束 如果
下一步
I'm looking for a for loop like the below
dim i as integer
dim j as integer = 5
For i = 0 To j
If i = 5 Then
i = 10
j = 20
End If
Next
if i=5 then I want to increment i to 10 and j to 20, so that loop will extend to 10 to 20
can anyone suggest me how to accomplish this.
解决方案
I think this will help
Dim i As Integer Dim j As Integer = 5 Dim k As Integer NextLoop: For i = k To j If i = 5 Then k = 10 j = 20 GoTo NextLoop End If Next
这篇关于用于循环迭代扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文