Well, you could write all the data to the file, without any code. Every dialog (multiple questions) could be an a separate file.
Then, you could write a function that loads the data from the file, and then enters a Repeat..Forever loop that allows the user to answer the questions until they end.
ff = WriteFile("questiondata.txt") For q.TQuestion = each TQuestion WriteLine ff, q\question$ WriteLine ff, q\answer1$ WriteLine ff, q\answer2$ WriteLine ff, q\answer3$ Next CloseFile ff
Then, you could write a function that loads the data from the file, and then enters a Repeat..Forever loop that allows the user to answer the questions until they end.
;;this code is incomplete Questionnaire("questions0001.txt") Function Questionnaire(file$) ff = Readfile(file$) Delete Each TQuestion ;;;---> read questions from file here CloseFile ff ;select first question q.TQuestion = First TQuestion Repeat ;;;---> Print first question ;;;---> Ask user to select answer ;;;---> Find the followup$ ;;;---> If followup$ = "" Then Exit ;;;---> find question the matches followup ;;;---> and select it (q.TQuestion = .. ) Forever Delete Each TQuestion End Function