R
RD
Hi all,
I've written some code that parses data out of Word forms and writes records to
an Oracle db. The amount of code is large because there are a lot of fields and
quite a bit of logic behind which fields are extracted and which table they are
written to.
When I first wrote the code I was declaring variables right before I needed
them. This was before we started looping through numerous files on the network
drive. Even now, I might go through a large percentage of the files in the
folder before finding one suitable to be parsed out. My thinking here was why
declare any variable until you need them? So, now I have a bunch of variables
declared within my loop.
I guess my question is, am I screwing myself by declaring variables in a loop?
Should I move all my variable declarations out of the loop?
Thoughts and insights appreciated,
RD
I've written some code that parses data out of Word forms and writes records to
an Oracle db. The amount of code is large because there are a lot of fields and
quite a bit of logic behind which fields are extracted and which table they are
written to.
When I first wrote the code I was declaring variables right before I needed
them. This was before we started looping through numerous files on the network
drive. Even now, I might go through a large percentage of the files in the
folder before finding one suitable to be parsed out. My thinking here was why
declare any variable until you need them? So, now I have a bunch of variables
declared within my loop.
I guess my question is, am I screwing myself by declaring variables in a loop?
Should I move all my variable declarations out of the loop?
Thoughts and insights appreciated,
RD