I set up the following control array using this code:
CODE
Dim index
Private Sub Option1_Click()
List1.Clear
For index = 0 To 9
List1.AddItem SampleRacks(index, 0)
Next
Text1.Text = ""
NumCol.Text = ""
NumRow.Text = ""
XPos1.Text = ""
YPos1.Text = ""
XPos2.Text = ""
YPos2.Text = ""
End Sub
Private Sub Option2_Click()
List1.Clear
For index = 0 To 9
List1.AddItem OutputRacks(index, 0)
Next
Text1.Text = ""
NumCol.Text = ""
NumRow.Text = ""
XPos1.Text = ""
YPos1.Text = ""
XPos2.Text = ""
YPos2.Text = ""
End Sub
Private Sub List1_Click()
If Option1.Value = True Then
Text1.Text = SampleRacks(List1.ListIndex, 0)
NumCol.Text = SampleRacks(List1.ListIndex, 1)
NumRow.Text = SampleRacks(List1.ListIndex, 2)
XPos1.Text = SampleRacks(List1.ListIndex, 3)
YPos1.Text = SampleRacks(List1.ListIndex, 4)
XPos2.Text = SampleRacks(List1.ListIndex, 5)
YPos2.Text = SampleRacks(List1.ListIndex, 6)
End If
If Option2.Value = True Then
Text1.Text = OutputRacks(List1.ListIndex, 0)
NumCol.Text = OutputRacks(List1.ListIndex, 1)
NumRow.Text = OutputRacks(List1.ListIndex, 2)
XPos1.Text = OutputRacks(List1.ListIndex, 3)
YPos1.Text = OutputRacks(List1.ListIndex, 4)
XPos2.Text = OutputRacks(List1.ListIndex, 5)
YPos2.Text = OutputRacks(List1.ListIndex, 6)
End If
End Sub
Private Sub Command1_Click()
If Option1.Value = True Then
SampleRacks(List1.ListIndex, 0) = Text1.Text
SampleRacks(List1.ListIndex, 1) = NumCol.Text
SampleRacks(List1.ListIndex, 2) = NumRow.Text
SampleRacks(List1.ListIndex, 3) = XPos1.Text
SampleRacks(List1.ListIndex, 4) = YPos1.Text
SampleRacks(List1.ListIndex, 5) = XPos2.Text
SampleRacks(List1.ListIndex, 6) = YPos2.Text
List1.Clear
For index = 0 To 9
List1.AddItem SampleRacks(index, 0)
Next
Else
OutputRacks(List1.ListIndex, 0) = Text1.Text
OutputRacks(List1.ListIndex, 1) = NumCol.Text
OutputRacks(List1.ListIndex, 2) = NumRow.Text
OutputRacks(List1.ListIndex, 3) = XPos1.Text
OutputRacks(List1.ListIndex, 4) = YPos1.Text
OutputRacks(List1.ListIndex, 5) = XPos2.Text
OutputRacks(List1.ListIndex, 6) = YPos2.Text
List1.Clear
For index = 0 To 9
List1.AddItem OutputRacks(index, 0)
Next
End If
End Sub
I'm referring to it using this code:
Private Sub Form_Load()
' reading the configuration file
'CONTENTS; data for the last procedure which was setup
'PortNumber
'ProcedureName
'SampleRackIndex
'OutputRack1Index
'OutputRack2Index
Open "config.spc" For Random As #1
Get #1, , filebuffer
PortNumber = filebuffer
Get #1, , filebuffer
ProcedureName = filebuffer
If ProcedureName = "" Then ProcedureName = "Default.zyp"
Text18.Text = ProcedureName
Get #1, , filebuffer
SampleRackIndex = filebuffer
Get #1, , filebuffer
OutputRack1Index = filebuffer
Get #1, , filebuffer
OutputRack2Index = filebuffer
Close 1
LoadProcedure (ProcedureName)
Dim index
For index = 0 To 9
Combo1.AddItem
SampleRacks(index, 0)
Next index
Combo1.ListIndex = SampleRackIndex
For index = 0 To 9
Combo2.AddItem OutputRacks(index, 0)
Next index
Combo2.ListIndex = OutputRackIndex
For index = 0 To 9
Combo3.AddItem OutputRacks(index, 0)
Next index
Combo3.ListIndex = OutputRackIndex
End Sub[code]
I get this error when I try to run it:
Compile error: Sub or Function not defined
The red word is highlighted. What am I forgetting to do?