|
-
Nov 24th, 2009, 08:42 PM
#1
Thread Starter
Junior Member
Indexof Problem
So I have the first form working, more or less an exact copy of what i'm about to post, but the problem I'm running into is that indexof(textbox1.text + " total") is indeed searching for the right thing, but it's not SEEING it, is there any reason for this? Here's the code.
Code:
'WAREHOUSE
Dim SKUSheet2 As New ArrayList
Dim ReturnValueWH As Integer
Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser(ofdWarehouse.FileName)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(vbTab)
Dim currentRow1 As String()
While Not MyReader.EndOfData
Try
currentRow1 = MyReader.ReadFields()
Dim currentField As String
For Each currentField In currentRow1
SKUSheet2.Add(currentField)
Next
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("Line " & ex.Message & _
"is not valid and will be skipped.")
End Try
End While
End Using
Dim Pachow As String = ""
Pachow = textSKU.ToString & " Total"
ReturnValueWH = SKUSheet2.IndexOf(Pachow.ToString)
If ReturnValueWH = -1 Then
textWarehouse.Text = "NOT FOUND"
Else
ReturnValueWH = ReturnValueWH + 1
textWarehouse.Text = SKUSheet2(ReturnValueWH)
Don't mind the pachow variable, I was tired and running out of variable names in my head. Now the format of the file is more or less like this.
SKU QUANTITY LOCATION
AD-DL-003 780 Q34-A
AD-DL-003 Total 780
AD-HP-026 10 Q12-A
A tab separates the columns in the file, it just doens't look like it here. It parses it correctly as far as I can tell, it outputs into a messagebox when i change it to do that. Why would it not be seeing the total part? Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|