asegal0000
Member
- Joined
- May 12, 2009
- Messages
- 5
- Programming Experience
- 10+
Structure AWGInfo
Dim AWG As Integer
Dim DiamMM As Double
Dim InsulDiamMM As Double
Dim GramsPerMeter As Double
Dim OhmsPerMeter As Double
End Structure
Dim X() As AWGInfo = {{1, 2.1, 3.1, 4.1, 5.1}, {6, 7.1, 8.1, 9.1, 10.2}}
On the Dim X() line, I get this error:
BC30332 Value of type 'Double(*,*)' cannot be converted to 'Form1.AWGInfo()' because 'Double' is not derived from 'Form1.AWGInfo'.
[Column 23]
If I change it to Dim X() As AWGInfo = {{1, 2.1, 3.1, 4.1, 5.1}, {6, 7.1, 8.1, 9.1, 10.2}}
I also have the error:
BC30672 Explicit initialization is not permitted for arrays declared with explicit bounds.
What I would like is:
X(0)
.AWG =1
.DiamMM = 2.1
.InsulDiamMM = 3.1
.GramsPerMeter = 4.1
.OhmsPerMeter = 5.1
X(1)
.AWG = 6
.DiamMM = 7.1
.InsulDiamMM = 8.1
.GramsPerMeter = 9.1
.OhmsPerMeter = 10.2
I know I can fill the array with code, but I prefer to do it at compile time just because of the amount of data that I have.
Any suggestions?
Dim AWG As Integer
Dim DiamMM As Double
Dim InsulDiamMM As Double
Dim GramsPerMeter As Double
Dim OhmsPerMeter As Double
End Structure
Dim X() As AWGInfo = {{1, 2.1, 3.1, 4.1, 5.1}, {6, 7.1, 8.1, 9.1, 10.2}}
On the Dim X() line, I get this error:
BC30332 Value of type 'Double(*,*)' cannot be converted to 'Form1.AWGInfo()' because 'Double' is not derived from 'Form1.AWGInfo'.
[Column 23]
If I change it to Dim X() As AWGInfo = {{1, 2.1, 3.1, 4.1, 5.1}, {6, 7.1, 8.1, 9.1, 10.2}}
I also have the error:
BC30672 Explicit initialization is not permitted for arrays declared with explicit bounds.
What I would like is:
X(0)
.AWG =1
.DiamMM = 2.1
.InsulDiamMM = 3.1
.GramsPerMeter = 4.1
.OhmsPerMeter = 5.1
X(1)
.AWG = 6
.DiamMM = 7.1
.InsulDiamMM = 8.1
.GramsPerMeter = 9.1
.OhmsPerMeter = 10.2
I know I can fill the array with code, but I prefer to do it at compile time just because of the amount of data that I have.
Any suggestions?