所以問題是,我有2個循環嵌套在另一個。外循環調用一個過程,內循環爲過程設置一個屬性供使用。問題是程序是我不想退出循環,使用pos - < - 屬性調用過程並重新進入內部循環。由於所有條件在內部循環內都是真實的,所以每次只更換一次pos,所以pos僅在一次設置。我希望能夠設置內部循環的pos出口,調用過程並重新進入內部循環並將其設置爲不同的值?任何幫助將是偉大的!這裏是代碼內部循環,程序調用混淆
For Each val As String In vals
If creditPoints = "20" And semester = "1" And year = "Year 1" Then
For Each position In MyPosList
If position.strLabel = "a1" And available(0) <> "False" Then
pos = position.strX & " " & position.strY
count += 1
available(0) = blnavailable
ElseIf position.strLabel = "b1" And available(1) <> "False" Then
pos = position.strX & " " & position.strY
count += 1
available(1) = blnavailable
Next
shortfat(semester, pos, creditPoints, title, year, modStatus, count)
End If
next
太多的代碼,請寫一個簡短的例子。 – vulkanino 2012-02-29 13:12:42
多數民衆贊成它縮短 – aspiringCoder 2012-02-29 13:18:44
爲什麼不調用內循環的過程? – Henrik 2012-02-29 13:22:56