Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.11 KB | None | 0 0
  1. for i := 0 to oldLine.MaxCounter - 1 do
  2.     begin
  3.       commentDefaultOld := oldDefaultLine.AntGetListWithTypes(i, [msTutorBefore]);
  4.     commentOld := oldLine.AntGetListWithTypes(i, [msTutorBefore]);
  5.     for j := 0 to Length(commentOld) - 1 do
  6.     begin
  7.       Res := ReadXMLTreeFromUnicodeString(CommentOld[j].TextValue);
  8.       ResDefault := ReadXMLTreeFromUnicodeString(CommentDefaultOld[j].TextValue);
  9.       if not Res.Success then Continue;
  10.       question := Res.Root.Values['goal'];
  11.       if (Res.Root.TagName = 'question') or (Res.Root.TagName = 'start') and (Pos('%', question) = 0) and (Pos('>', question) = 0) then
  12.       begin
  13.         for k := 0 to storLine.MaxCounter - 1 do
  14.         begin
  15.           commentNew := storLine.AntGetListWithTypes(k, [msTutorBefore]);
  16.           for l := 0 to Length(commentNew) - 1 do
  17.           begin
  18.             ResNew := ReadXMLTreeFromUnicodeString(CommentNew[l].TextValue);
  19.             if not ResNew.Success then
  20.               Continue;
  21.             if Res.Root.TagName = 'question' then
  22.             begin
  23.             if ResNew.Root.TagName = 'question' then
  24.             begin
  25.               if (ResNew.Root.Children[0].Values['val'] = ResDefault.Root.Children[0].Values['val']) and (ResNew.Root.Children[1].Values['value'] = ResDefault.Root.Children[1].Values['value']) then
  26.               begin
  27.                 storLine.AntDeleteTypeRecord(k, l+1, msTutorBefore);
  28.                 storLine.AntInsertText(k, l+1, msTutorBefore, WriteXMLToUnicodeString(Res.Root));
  29.               end;
  30.             end;
  31.             end;
  32.             if Res.Root.TagName = 'start' then
  33.             begin
  34.             if ResNew.Root.TagName = 'start' then
  35.             begin
  36.               if (ResNew.Root.Values['goal'] = ResDefault.Root.Values['goal']) then
  37.               begin
  38.                 storLine.AntDeleteTypeRecord(k, l+1, msTutorBefore);
  39.                 storLine.AntInsertText(k, l+1, msTutorBefore, WriteXMLToUnicodeString(Res.Root));
  40.               end;
  41.             end;
  42.             end;
  43.             ResNew.Root.Free;
  44.           end;
  45.         end;
  46.       end;
  47.       Res.Root.Free;
  48.     end;
  49.   end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement