Tuesday, March 29, 2011

AutoIT: Variables and Includes

A variable is simply a named placeholder for a string or array of data. You can use a variable as many times as you need within a script and it only requires declaration once. This allows you to manage and manipulate data in a centralized location if desired.
Variables are a necessity if you want to write robust scripts that are fairly simple to modify. For example, defining a filename as a variable allows you to change the filename from a single location instead of changing many static entries. (Using static data entries can lead to problems.) Example 1 installs two Windows XP Security updates. Example 2 performs the same operations, but does so using
variables. You may not yet understand everything displayed in the examples; they are only meant to show that replacing filenames with variables is one way to simplify your code.

No comments:

Post a Comment