I have a .txt file which contains the following:
@ Тест "Название теста" @ %1. Вопрос теста % ~ 1) вариант ответа 2) вариант ответа 3) вариант ответа 4) вариант ответа ~ 1 (правильный вариант) If there are '@' characters - then this is the test header unloaded in Edit, if '%' - then this is a question unloaded in Memo, if '~' - then these are the response options unloaded in RadioGroup. Questions in the test.txt can be a different number.
What I need to do: the program should read the file and, depending on which character goes, insert the component on the form and output the text to the component until the same next character.
Here is an example of how I tried to display the header by uploading the .txt file to Memo, and from Memo to the previously created Edit component:
for k:=0 to Memo1.Lines.Count-1 do begin if AnsiPos('@', Memo1.Lines[k])<>0 then begin Edit1.Text := Memo1.Lines.Strings[k]; end; if AnsiPos('@', Memo1.Lines[k]) = 1 then break; end; I can not create components and display questions and answer options.