我想运行这样的东西:
原文链接:https://www.f2er.com/vb/255286.htmlFor a = 0 To 4 For b = a To 4 For c = b To 4 Console.WriteLine(a & b & c) Next Next Next
但我需要互相创建n个循环.所以我创建了这个方法:
'iFrom = 0; iTo = 4; Depth = 3(loop count); Private Sub Iterate(ByVal iFrom As Integer,ByVal iTo As Integer,ByVal Depth As Integer) For i = iFrom To iTo If Depth - 1 > 0 Then Iterate(iFrom,iTo,Depth - 1) 'Do stuff here Next End Sub