input from file

scorpion555

Member
Joined
Feb 14, 2003
Messages
10
Location
el paso, texas
hello

I need to display different things (either radio or check boxes) on a form (I need to do a survey) from a file, but i also need to display the answers from the same text file, can I do this with stream reader??? (in other words can set some lines to a variable)if so how would the syntax be??:) :) (the book I have doesnt have any instructions on how to do this)

text file:
radio buttons
pizza, tacos, burgers, salads

(pizza, tacos, burgers, salads are the answers on the survey)

Ineed to do this because the user cant program, so they only need to modify the text file without programming
Any suggestions, comments, or any better way to go around this???

Thanks in advance:D :D
 
Im not sure what you mean :)
You want to read a file, create a radio button for every option, and the check if the correct one was checked?
 
well the professor wants a program where he can modify the text so the program will run according to his instructions, however hes a psyc prof. so he cant program. The text file will say what kind of questions it is (radio buttons or check boxes).

Thats the part I am worried about, how can I check the text file in order to set the check box or radio button visible?

I know just found out about the input function, ill play around with that,till then I dont know how to go around it.

Thanks :D
 
I think an XML file would be great for this kind of thing. Its a lot easier to navigate than normal files.
Im still not sure about the rest becuase you didnt answer my question :).
 
Sorry for not making my self clear I do want to read a file, create a radio button for every option, and the write to another file which button was chosen, i got the program to read from the file so i can display the question and answers, but i am only able to read the first question, still working on that.....

about the suggestion, yes it could problably be done in other ways, xml would problably be the best one, but for some reason they just wanted a standalone program. (it would have made my job easier)
 
Originally posted by scorpion555
Sorry for not making my self clear I do want to read a file, create a radio button for every option, and the write to another file which button was chosen, i got the program to read from the file so i can display the question and answers, but i am only able to read the first question, still working on that.....

about the suggestion, yes it could problably be done in other ways, xml would problably be the best one, but for some reason they just wanted a standalone program. (it would have made my job easier)

------------------------------------------------
Here is the code to Read From File
Dim TestFile As FileStream = New FileStream _
("C:\test.txt", FileMode.Open)
Dim FileReader As StreamReader = New StreamReader(TestFile)
TextBox1.Text = FileReader.ReadToEnd
TestFile.Close()
FileReader.Close()
 
Back
Top