Welcome, Guest
Username: Password: Remember me
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

An error with xml_Dom RemoveChild 1 year 3 months ago #17428

  • Brues
  • Brues's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0
procedure TfrNet.Button2Click(Sender: TObject);
var
  i:Integer;
  xml:TXMLDocument;
  dnl:TDomNodeList;
  nowNode:TDomNode;
begin
  if CheckListBox1.ItemIndex<0 then
  showmessage('No data to delete.') else
  begin
  try
    ReadXMLFile(xml,'Config.xml');
    dnl:=xml.GetElementsByTagName('AppTimes');
    if dnl.Count>0 then
    for i:=0 to dnl.Count-1 do
      begin
        if TDomElement(dnl.FirstChild).TextContent=CheckListBox1.Items[CheckListBox1.ItemIndex] then
        begin
          nowNode:=dnl;
          nowNode.parentNode.RemoveChild(nowNode);
          CheckListBox1.Items.Delete(CheckListBox1.ItemIndex);
        WriteXMLFile(xml,'Config.xml');
        end;
      end;
    finally
      xml.Free;
    end;
  end;
end;                            

==debug==
Error: Engineering NTC Citation Exception Class 'External: SIGSEGV'.

In the file 'laz2_dom.pas' on line 1324:
Result := DetachChild(OldChild);

Please Log in or Create an account to join the conversation.

Last edit: by Brues. Reason: Re-edit

An error with xml_Dom RemoveChild 1 year 3 months ago #17431

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1047
  • Thank you received: 145
Any sample project for test ?
Your CodeTyphon Version ?
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

An error with xml_Dom RemoveChild 1 year 3 months ago #17433

  • Brues
  • Brues's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0
It can be used normally in another unit, and the operation method is the same

Typhon Version 7.9
Revision:2209101845

Please Log in or Create an account to join the conversation.

  • Page:
  • 1