Dim firsthash As Integer = 0 Dim secondhash As Integer = 0 Dim prodnum As String Dim tempchar As String = "" prodnum = IntrolProductNumberTextBox.Text '**** FIND THE FIRST HASH **** tempchar = prodnum.IndexOf("-") firsthash = tempchar tempchar = 0 '**** FIND THE SECOND HASH **** tempchar = prodnum.Substring(prodnum.IndexOf("-") + 1).IndexOf("-") secondhash = (tempchar + firsthash) + 1 ' **** POPULATE THE ARRAY WITH THE FIRST SECTION OF MOTOR DATA **** section(STACK_LENGTH) = prodnum.Substring(firsthash - 1, 1) section(FINISHED_GOOD) = prodnum.Substring(0, 1) section(SERVOLOC_SERIES) = prodnum.Substring(1, 2) If firsthash > 6 Then section(FRAME_SIZE) = prodnum.Substring(3, 3) Else section(FRAME_SIZE) = prodnum.Substring(3, 2) End If ' **** POPULATE THE ARRAY WITH THE SECOND SECTION OF MOTOR DATA **** section(MOUNTING_OPTION) = prodnum.Substring(secondhash - 1, 1) section(VOLTAGE) = prodnum.Substring(secondhash - 2, 1) If (secondhash - firsthash) > 5 Then section(MOTOR_KE) = prodnum.Substring(firsthash + 1, 3) Else section(MOTOR_KE) = prodnum.Substring(firsthash + 1, 2) End If '' **** POPULATE THE ARRAY WITH THE THIRD SECTION OF MOTOR DATA **** section(FEEDBACK) = prodnum.Substring(secondhash + 1, 4) section(TERMINATION) = prodnum.Substring(secondhash + 5, 1) section(BRAKE_OPTION) = prodnum.Substring(secondhash + 6, 1) section(OTHER_OPTIONS) = prodnum.Substring(secondhash + 7, 1)