I am trying to make a change to to an old application in which a three dimensional array was hard coded as follows:
GC(1, 1, 1) = 0.059
GC(2, 1, 1) = 0.059
GC(3, 1, 1) = 0.059......etc
Here is the old code that initialized each value:
Code:
Private Function lowestgauge(width As Double, thickness As Double, grade As String) As Double
Dim wrt As Integer
Dim increment As Integer
Dim srt As Integer
Dim grt As Integer
Dim inch As Integer
Item = adoSchdRs.Fields(0)
coil_id = adoSchdRs.Fields(7)
'get the width range number from the lookup table
width = adoSchdRs.Fields(9)
increment = 1
inch = 30
Do Until inch <= width And width < (inch + 1)
inch = inch + 1
increment = increment + 1
wrt = increment
Loop
'end of get the width range number from the lookup table
'next get the thickness number
thickness = adoSchdRs.Fields(2)
Select Case thickness
Case Is < 8
srt = 1
Case Is >= 8
srt = 2
End Select
'end get the thickness number
'lastly we need the grade lookup number
grade = adoSchdRs.Fields(6)
Select Case grade
Case 1005 To 1008, "0409", "MLS1", "MLS2", "MLS3"
grt = 1
Case 1010 To 1015, 1211
grt = 2
Case "1P10", "1P12"
grt = 2
Case 1016 To 1020
grt = 3
Case "1P15"
grt = 3
Case 1021 To 1025
grt = 4
Case 1026 To 1040, "1M23", "1B06"
grt = 5
Case 1041 To 1065
grt = 6
Case 1066 To 1095, 4130
grt = 7
Case "0655", "O655", "C655", "409A"
grt = 8
Case Else
grt = 1 'grade wasn't found...use grt=1
End Select
'done with grade lookup number
lowestgauge = GC(wrt, srt, grt)
End Function
Now the data is stored in a text file as follows:
1005-1008 under 8" slab,0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.065, 0.065, 0.065, 0.065, 0.065, 0.07, 0.07, 0.072, 0.076, 0.078, 0.082, 0.085
Can anyone help me as to how I would build the same array that was hard coded by reading this text file?