[Gambas-user] xml.save()

Antonio Carlos Siqueira acgs1306 at ...494...
Wed Jul 11 12:05:24 CEST 2012


sory, this is the sources.

# Gambas Form File 3.0

{ Form Form
   MoveScaled(0,0,33,46)
   { save Button
     MoveScaled(4,39,10,4)
     Text = ("Save")
   }
   { TextArea1 TextArea
     MoveScaled(3,3,27,34)
   }
   { open Button
     MoveScaled(16,39,14,4)
     Text = ("Re Open")
   }
}

' Gambas class file

Public Myxml As New XmlDocument
Public data As XmlElement[]

Public Sub _new()
' by now I will do not tests
    Myxml.Open("file.xml")
    data = Myxml.GetElementsByTagName("data")
End

Public Sub Form_Open()
    TextArea1.Text = data[0].Value
End

Public Sub save_Click()
    Myxml.Save("file.xml")
End

Public Sub open_Click()
    Myxml.Open("file.xml")
    data = Myxml.GetElementsByTagName("data")
    TextArea1.Text = data[0].Value
End

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <data>
   this thing.
  </data>
</root>

now i think you can test.

thanks
AC





More information about the User mailing list