Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27333

VS 2010 declare/dimension multiple object using for, possible?

$
0
0
forse mi sono espresso male

i have to declare multiple ojject, in this particular case streamreader/writer whitout declare all manually

for i=0 to 50
dim variablename(i can use i value too) as new streamreader(Application.StartupPath & "\temp\" & i & ".txt")
next

but i got error, is possible in another way?
or have to declare all manually?

Dim sw As New StreamWriter(Application.StartupPath & "\temp\0.txt", True)
Dim sw1 As New StreamWriter(Application.StartupPath & "\temp\1.txt", True)
Dim sw2 As New StreamWriter(Application.StartupPath & "\temp\2.txt", True)
Dim sw3 As New StreamWriter(Application.StartupPath & "\temp\3.txt", True)
Dim sw4 As New StreamWriter(Application.StartupPath & "\temp\4.txt", True)
Dim sw5 As New StreamWriter(Application.StartupPath & "\temp\5.txt", True)

Viewing all articles
Browse latest Browse all 27333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>