Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can help me with CWArray1.SetArray in VB6?

Hi, I would like to set all of the elements from a one dimensional array to a constant value.
I tried it with CWArray1.SetArray(vArray(), vConst), but it doesn't work.
Where is the Problem?
Can anybudy help me?
I work with VB6.

Thanks Manfred
m.tasser@jenbacher.com
0 Kudos
Message 1 of 2
(3,266 Views)
How does SetArray not work? Are you getting a compile error, a runtime error, or no errors but unexpected results? If you still can't get SetArray to work, you could do something like this:

Private Sub InitializeArray(data() As Double, value As Double)
Dim i As Integer
Dim lowerBound As Integer
Dim upperBound As Integer

lowerBound = LBound(data)
upperBound = UBound(data)
For i = lowerBound To upperBound
data(i) = value
Next
End Sub

- Elton
0 Kudos
Message 2 of 2
(3,266 Views)