我正在使用vb.net
我有以下对象数组,我想从给它一个名称中提取所有真实值并将其添加到数组中这是对象数组
这是我到目前为止所尝试的:
Dim myarray() As String
Dim number As Integer = 0
If resultArray(0).BolComment Then
myarray(number) = "comment"
number = number + 1
End If
If resultArray(0).BolComplete Then
myarray(number) = "complete"
number = number + 1
End If
If resultArray(0).BolFinished Then
myarray(number) = "Finished"
number = number + 1
End If
If resultArray(0).BolOutCome Then
myarray(number) = "OutCome"
number = number + 1
End If
If resultArray(0).BolStatred Then
myarray(number) = "Started"
number = number + 1
End If
If resultArray(0).BolUser Then
myarray(number) = "User"
number = number + 1
End If
这给了我一个错误:该变量之前已使用过
问题我如何提取所有具有true
价值的项目并将push
其提取到一个新数组中with
,给它一个新的name
谢谢