
Next, we implement a function to read the XML. Note that this code doesn't do anything just yet, because we haven't yet implemented the function readPreferencesToXMLTree and the command processPreferencesTree. # This will free up the memory that the tree was using and prevent our application # using more memory than it needs or "leaking" memory by creating multiple trees # without closing any of them. If tTree is empty then exit loadPreferencesĮnd if # Read the preferences we require from the tree and display them. Put readPreferencesToXMLTree() into tTree The tree is represented as a number, the actual tree structure and data is managed by LiveCode and so we don't need to worry about it. This function reads the XML file, and returns the tree. The second part is to process the tree and extract the data from it. The first part is reading the file into memory and creating an XML "tree". There are two parts to loading the preferences file. When the button is clicked, load up the preferences and put them into the field on mouseUp For this example we are going to load an XML file that contains preferences for our application.īegin the script with the following code:ġ.

Edit the script of the button by selecting it, then clicking on the "Script" button in the main menu bar.
