Here is my code:
Private Sub EditRecipe_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
strFilePath = My.Application.Info.DirectoryPath & "\" & strOpenedRecipe & ".txt"
'strOpenedRecipe is a public variable assigned a value in the previous form.
MsgBox(strFilePath)
'This message box says that there is no problem with the file path
FileSystem.FileOpen(intFileIndex, strFilePath, OpenMode.Input)
FileSystem.Input(intFileIndex, strRecipe)
'If I put a "MsgBox(strRecipe)" in here it shows the correct value for the strRecipe variable
FileSystem.Input(intFileIndex, intPeople)
FileSystem.Input(intFileIndex, intIngredients)
FileSystem.FileClose(intFileIndex)
'But anything after this point doesn't seem to work. If I put another "MsgBox(strRecipe) in here it does not display it
ReDim strIngredients(intIngredients - 1)
ReDim strQuantities(intIngredients - 1)
ReDim strUnits(intIngredients - 1)
lblRecipe.Text = strRecipe
txtPeople.Text = intPeople
lboxIngredients.Items.Clear()
For i = 0 To UBound(strIngredients) 'All of this code doesn't seem to be performed
FileSystem.Input(intFileIndex, strIngredients(i))
FileSystem.Input(intFileIndex, strQuantities(i))
FileSystem.Input(intFileIndex, strUnits(i))
lboxIngredients.Items.Add(strQuantities(i) & " " & strUnits(i) & " of " & strIngredients(i))
Next
FileSystem.FileClose(intFileIndex)
End Sub
I have never encountered anything like this before, and I was wondering if you guys could help.
Many thanks,
Matt

New Topic/Question
Reply



MultiQuote






|