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

VS 2012 Setting up StreamReader to use 3 different text files

$
0
0
I need advice setting up StreamReader.
This is for a game. 3 radio buttons are supposed to control access to 3 text files (difficulty level).
I can get it to work for one. I declare (Dim) a new StreamReader and then open the file.
But if I try to Dim inside an "If, Them" statement to make a choice based on the radio buttons, I get an error because 'SR System' is 'Friend.

Could anyone suggest a basic organization for this set-up?

I have a loop for loading the text from the file into an array and choosing a random word. I just want to be able to specify any one of the three text files to run in the loop (one variable).

Thanks!

Viewing all articles
Browse latest Browse all 27355

Trending Articles



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