Squirrel/Server/Functions/XmlDocument/Clear

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Fixed title)
m (Not a command, but a script)
 
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
This command will load an XML document into the scripts and empty it immediately.
+
This script will load an XML document into the scripts and empty it immediately.
  
 
<code lang="squirrel">
 
<code lang="squirrel">

Latest revision as of 14:29, 3 July 2013

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function empties an XML document.

[edit] Syntax

  1. bool XmlDocument.Clear( )

[edit] Arguments

  • None

[edit] Example

This script will load an XML document into the scripts and empty it immediately.

  1.  
  2. function onScriptLoad()
  3. {
  4. // Load the file itself
  5. local myDocument = XmlDocument();
  6. myDocument.LoadFile( "Example.xml" );
  7.  
  8. // Empty it entirely
  9. myDocument.Clear();
  10. }
  11.  

[edit] Notes

The callback onScriptLoad and functions XmlDocument.LoadFile and XmlDocument were used in this example. More info about them is available in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox