我有以下代碼:環路通過與聲明
Public Class Compress
Public Shared Sub delta()
Dim results As New Compress()
With results
....
...
...
End With
end sub
end class
如何訪問到的元素從聲明?我想循環是這樣的:
for each element in results
....
Next
所以,目前我用下面的語句語句之後添加的每個元素行:
Sumtable.Rows(Sumtable.Rows.IndexOf(row))("Stdflow" & tmp) = Math.Round(results.flow, 2)
Sumtable.Rows(Sumtable.Rows.IndexOf(row))("Stdvol" & tmp) = Math.Round(results.vol, 2)
Sumtable.Rows(Sumtable.Rows.IndexOf(row))("k" & tmp) = Math.Round(results.k, 2)
Sumtable.Rows(Sumtable.Rows.IndexOf(row))("VOS" & tmp) = Math.Round(results.vos, 2)
Sumtable.Rows(Sumtable.Rows.IndexOf(row))("μ" & tmp) = Math.Round(results.μ, 2)
但我想循環槽結果獲得一個由一個元素,以避免不必要的編碼
對於結果中的每個元素都不起作用?顯示什麼錯誤? – Ryan
錯誤BC32023表達式的類型爲'',它不是一個集合類型 – badscrool
什麼是'Compress'應該表示它有項目,這些項目代表什麼?很有可能適當的行爲是繼承'Connection(Of T)',它已經實現了'IList(Of T)',並且爲你提供了所有的列表功能。 – jmcilhinney