J
Jacob.Bruxer
Hi,
I'm pretty new to Visual Basic and was wondering if anyone could give
some general advise on how to conserve memory when running a Visual
Basic program that I've created. I keep getting a "Win32 exception was
unhandled" error, and I'm pretty sure resource usage is the problem.
This might be way too general of a question, so I'll try to explain
what it is I'm trying to do as briefly as I can.
Basically, my program reads a text file that's about 30 kb in size, and
about 450 lines long. Each line contains 8 comma delimited variables.
I use the System.IO.StreamReader tool to do this, and read each line
seperately and store each line in a String array. I then create
another array called "variable(7)" (one space for each comma seperated
value). I have a For loop that then changes the text in a combo box
and a number of text boxes to be read later. Looks something like this
(Note: j = total number of lines + approx. 450):
Dim variable(7) As String
For i = 1 To j
variable = Split(ReaderText(i), ",")
cboxSecType.Text = variable(0)
txtMannings.Text = variable(1)
txtLength.Text = variable(2)
txtSlope.Text = variable(3)
txtPeakFlow.Text = variable(4)
txtTimeToPeak.Text = variable(5)
txtNSAVE.Text = variable(6)
Call WriteMultiInput()
ProgressBar.Value = ProgressBar.Value + 1
Next i
The string array variable(7) is only created once, but the values in
variable(7) change as I'd like them to each time through the For loop.
The function Call WriteMultiInput() shown above in the For loop
basically writes and saves a new textfile for each loop using the
variables above plus a number of others, some of which change
automatically depending on the variables that are initially read. Each
of the text files written is pretty small - about 3 to 5 kb in size.
There are a number of other variables that are saved when writing each
new text file.
Overall my program works as I want it to. It runs and writes the text
files exactly as I'd like it to up to a certain point (approximately 50
text files, approx. 3-5 kb per file, total of about 205 kb). But it
stops around 50 and I'd like to get it to the 450 I'm trying to read.
So, I hope that wasn't too long-winded, but if you're still with me,
any thoughts?
I'm pretty new to Visual Basic and was wondering if anyone could give
some general advise on how to conserve memory when running a Visual
Basic program that I've created. I keep getting a "Win32 exception was
unhandled" error, and I'm pretty sure resource usage is the problem.
This might be way too general of a question, so I'll try to explain
what it is I'm trying to do as briefly as I can.
Basically, my program reads a text file that's about 30 kb in size, and
about 450 lines long. Each line contains 8 comma delimited variables.
I use the System.IO.StreamReader tool to do this, and read each line
seperately and store each line in a String array. I then create
another array called "variable(7)" (one space for each comma seperated
value). I have a For loop that then changes the text in a combo box
and a number of text boxes to be read later. Looks something like this
(Note: j = total number of lines + approx. 450):
Dim variable(7) As String
For i = 1 To j
variable = Split(ReaderText(i), ",")
cboxSecType.Text = variable(0)
txtMannings.Text = variable(1)
txtLength.Text = variable(2)
txtSlope.Text = variable(3)
txtPeakFlow.Text = variable(4)
txtTimeToPeak.Text = variable(5)
txtNSAVE.Text = variable(6)
Call WriteMultiInput()
ProgressBar.Value = ProgressBar.Value + 1
Next i
The string array variable(7) is only created once, but the values in
variable(7) change as I'd like them to each time through the For loop.
The function Call WriteMultiInput() shown above in the For loop
basically writes and saves a new textfile for each loop using the
variables above plus a number of others, some of which change
automatically depending on the variables that are initially read. Each
of the text files written is pretty small - about 3 to 5 kb in size.
There are a number of other variables that are saved when writing each
new text file.
Overall my program works as I want it to. It runs and writes the text
files exactly as I'd like it to up to a certain point (approximately 50
text files, approx. 3-5 kb per file, total of about 205 kb). But it
stops around 50 and I'd like to get it to the 450 I'm trying to read.
So, I hope that wasn't too long-winded, but if you're still with me,
any thoughts?