Jump to content

Saving Output As INI or XML Format


Recommended Posts

This is very subjective.

INI files don't have much freedom. There is something like a 64kb filesize limitation imposed by windows, and also like a 255 character limit on values.

XML isn't supported natively by AutoIt so you will have to rely on an included UDF to work with it.

XML allows the user to define the structure. Here is a small example:

<?xml version="1.0" encoding="iso-8859-1"?>
  <root>
      <folder name="Windows">
          <file name="calc.exe" size=""/>
          <folder name="System32">
              <file name="cmd.exe" size="388608"/>
          </folder>
      </folder>
      <folder name="Program Files">
          <folder name="AutoIt3">
              <folder name="Examples">
                  <folder name="GUI">
                  </folder>
              </folder>
              <folder name="Includes">
              </folder>
          </folder>
      </folder>
  </root>

XML nodes are essentially like structure objects. You can play god with them. The following 2 examples will produce the same results.

Node value storage:

<root>
     <folder>
         <name>Windows</name>
         <file>
             <name>explorer.exe</name>
             <size>1033216</size>
         </file>
     </folder>
 </root>

Attribute storage:

<root>
     <folder name="Windows">
         <file name="explorer.exe" size="1033216"/>
     </folder>
 </root>

How would you translate this to ini?? You could probably only do it with multiple ini files and it would be a logistical nightmare.

Edited by weaponx
Link to comment
Share on other sites

Cheers

This is very subjective.

INI files don't have much freedom. There is something like a 64kb filesize limitation imposed by windows, and also like a 255 character limit on values.

XML isn't supported natively by AutoIt so you will have to rely on an included UDF to work with it.

XML allows the user to define the structure. Here is a small example:

<?xml version="1.0" encoding="iso-8859-1"?>
  <root>
      <folder name="Windows">
          <file name="calc.exe" size=""/>
          <folder name="System32">
              <file name="cmd.exe" size="388608"/>
          </folder>
      </folder>
      <folder name="Program Files">
          <folder name="AutoIt3">
              <folder name="Examples">
                  <folder name="GUI">
                  </folder>
              </folder>
              <folder name="Includes">
              </folder>
          </folder>
      </folder>
  </root>

XML nodes are essentially like structure objects. You can play god with them. The following 2 examples will produce the same results.

Node value storage:

<root>
     <folder>
         <name>Windows</name>
         <file>
             <name>explorer.exe</name>
             <size>1033216</size>
         </file>
     </folder>
 </root>

Attribute storage:

<root>
     <folder name="Windows">
         <file name="explorer.exe" size="1033216"/>
     </folder>
 </root>

How would you translate this to ini?? You could probably only do it with multiple ini files and it would be a logistical nightmare.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...