ah I kept thinking you had to define the length of the array for the writealllines but you don't. Thanks for the help.
this is the resolution in case another lost souls wanders this way.
Toneinv(0) = txtDell330.Text
Toneinv(1) = txtLex360.Text
Toneinv(2) = txtLJ4000.Text...
okay so I did what you said but there was a problem.
Toneinv(0) = txtDell330.Text
Toneinv(1) = txtLex360.Text
Toneinv(2) = txtLJ4000.Text
Toneinv(3) = txtLJ4100.Text
Toneinv(4) = txtLex260.Text
Toneinv(5) = txtDell1815.Text
' Dim kj As New...
using a stringwriter inside a loop
okay so here is what I am attempting to to. I am trying to take the variable in the textboxes move them into an array and they write each value in the array to a line in the text file.
Dim swtoner As New StringWriter()
Toneinv(0) =...
maybe I am not understanding how string writer works because my declaration produces an error.
Dim swtoner As New StringWriter(txtInvtoner)
This is my declaration above and below is the error when I click the button this code is attached to. txtInvtoner is my path info to the text file...
updated question
okay I used something different to read the text file. but now i have a new problem. I am using the form load event combine with a loop to read the text file into a public array. Then assigning the values of the array to different textboxes.
the problem is that the loop runs...
I have been trying to remember how to read each line in a txt file into an array on form load. But i haven't messed with vb in months and I can't remember how loop through properly.
Imports SystemImports System.IO
Imports System.Windows
Public Class Form1
Dim txtInvtoner As String =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.