: Well.. my situation is like that.I wrote a problem provide many questions, you can choose the number of question you wanna answer.
: Once you choose the answer the hint will show in the program.ALL question, answer and hint I used 3 different txt files put them.
: Here is the problem:
: 1.How can I know the first line and second line only in the no.1 question load 3 and 4 line only in the no.2 question.
: 2.How can I check the answer to compare with the answer in the name of "answer" file.
: 3.How to prevent the users play the same question again.
The access to textfiles is quite limited; you cannot move up and down the file. ou can however move to the start of the file (Reset() procedure). Here is a sample code to read 2 lines from a textfile based on an integer called Index:
for i := 1 to Index do
In your case Index is the question number.
2. With a slight modification the code above can also be used here. Just remove the reading of the second line and change the file variable of course.
3. Keep a list of the questions the user already has answered. The best method is to use an array of booleans. The only problem is that you cannot have more than about 64000 different questions this way. You can multiply that number by 8, if you create a code to use bits instead of booleans.