-
can anyone help me as I feel i am a bit too thick I have design a quiz using a text file ( Thats where the data is save) the problem is how do i move on to the next line and how can i check if the question is right here is a example
Question : Who is Bill Gate
answer a) owner of MS
b) rich ass hole
c) don't care
ok we know the correct answer is a but how do i load this up in a option box or a u know the question is how to i move on to the next question until it is the end of the file ...... email me on [email protected] please
-
Um.... uh...
I don't exactly understand your question but I think I might. Your using a .ini file to store questions and their possible answers, right? So, what I'd do, is go to the tutorials area of this web site, do a search for how to read a .ini file, make a list in your program of the names of the questions and then just go through that list, having those names being the same names you use for the questions in the .ini file.
At least... I think that's what you mean, hope this helps! :)
-
Code:
Open QuizFile For Input As #1
Do While Not(EOF(1))
Line Input #1, QandA
MsgBox QandA
Loop
Close
This will loop trough every line in the textfile and display each line in a msgBox, it would be the best to store the answers/questions like
Who's tha man? Jop,You,Me
And use the split function (if you're using VB6) to split the ,(the Answers) and a space (the Question)
You could load them in a ComboBox then by doing
Code:
'Loop trough available answers (you have to code it yourself :)
For Answer1 To Answer3
ComboBox1.AddItem Answers
'(can't test it now, look at the variables to check wich one)
Next Answer1
You could also store the A's in an array
Hope it helped a bit.
Add me for more info (18818940)
-
Eep!
Waste of code :), use an initiation file unless security is really an issue.