This code is sorted by rows.
How to solve this problem: If the line, in a memo , is filled, then take these parameters into account for sorting . And if not filled then do not take into account. In my case, it turns out that all strings, even empty ones, are sorted. What is there to add that would work so?
//работаем по строкам в файле while not Eof(fall) do begin //читаем строку ReadLn(fall, S); if (Pos(AnsiLowerCase(Memo1.Lines[0]), AnsiLowerCase(s)) > 0) then writeln(REZ1, S); if (Pos(AnsiLowerCase(Memo1.Lines[1]), AnsiLowerCase(s)) > 0) then writeln(REZ2, S); if (Pos(AnsiLowerCase(Memo1.Lines[2]), AnsiLowerCase(s)) > 0) then writeln(REZ3, S); ................................ и так далее... When I do through checkboxes + Edit, this is how it all works much faster (That is, I tick the edit where they are filled in). But it's not so convenient, it's more convenient through memo:
while not Eof(fall) do begin //читаем строку ReadLn(fall, S); if CheckBox1.Checked and (Pos(AnsiLowerCase(Edit1.Text), AnsiLowerCase(s)) > 0) then writeln(f1, S); if CheckBox2.Checked and (Pos(AnsiLowerCase(Edit2.Text), AnsiLowerCase(s)) > 0) then writeln(f2, S); if CheckBox3.Checked and (Pos(AnsiLowerCase(Edit3.Text), AnsiLowerCase(s)) > 0) then writeln(f3, S); ................................ и так далее...