我在程序中调用了一个类来进行一些计算。现在有必要多次调用这个类,因为我需要对所有数据库表行成员进行此计算。我有For... Next
,但它不能正常工作,每次它只返回最后一次调用计算量到数据库时,代码的一部分是这样的:
For j As Integer = 0 To symbols.Rows.Count - 1
Dim spread As Double
Dim digits As Integer = symbols.Rows(j)("Digits")
Dim symbolgroupconditionrow = symbolsgroupcondition.Select("ID = '" & symbols.Rows(j)("SymbolGroupID") & "'")
Select Case digits
Case 0
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 1)
Case 1
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 0.1)
Case 2
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 0.01)
Case 3
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 0.001)
Case 4
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 0.0001)
Case 5
spread = ((symbols.Rows(j)("Spread") + symbolgroupconditionrow(0)("SpreadTopup")) * 0.00001)
End Select
Dim qclient As New Quotereader
qclient.GetWord("iqlink", symbols.Rows(j)("Symbol"), "last", spread)
Next j
该对象Quotereader
位于我之前导入的类文件中,现在我的问题是有没有办法以多个名称“暗淡新”一个对象,例如:
Dim qclient(10) As New Quotereader
For I = 0 to 9
qclient(I).GetWord("iqlink", symbols.Rows(j)("Symbol"), "last", spread)
Next I
或任何其他方式?