<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mdiesel</id>
	<title>AutoIt Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mdiesel"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/Mdiesel"/>
	<updated>2026-04-04T18:55:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=11634</id>
		<title>Talk:UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=11634"/>
		<updated>2013-04-28T04:42:17Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Variable naming conventions */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is currently under construction by Mat. It is being ported from this page: [http://dl.dropbox.com/u/22257420/Programming/UdfSpec.html]&lt;br /&gt;
&lt;br /&gt;
All content has been copied across, but links may not work and formatting may be broken.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mat|Mat]] 09:28, 16 November 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Outdated information ==&lt;br /&gt;
New updates to AutoIt are including changes to the syntax. Certain sections of this document will need to be revisited. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* There are a number of places where current headers differ slightly from these standards. &lt;br /&gt;
** Structures aren&#039;t using the Related field. It was added here as it is looked for by the docs generator, and should be there anyway.&lt;br /&gt;
** Structures have a varied naming convention, not always following the rule of including the type notation. Particularly StructureConstants.au3.&lt;br /&gt;
* The header for _WinAPI_GetMousePos isn&#039;t as it appears above, but it should be.&lt;br /&gt;
* Variable naming is still a matter of personal style. As long as it&#039;s readable and makes sense then it is acceptable. That part remains a guideline as opposed to a standard.&lt;br /&gt;
* There probably needs to be two versions of this document. One for MVPs working directly with the UDFs and examples and another for other community members working on non-standard UDFs.&lt;br /&gt;
&lt;br /&gt;
== Coding Practice ==&lt;br /&gt;
&lt;br /&gt;
This page does not currently cover coding practices other than naming conventions. The topic of programming best practice is very broad and so I have no intention of adding it to this page.&lt;br /&gt;
&lt;br /&gt;
Useful links:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/146866-best-coding-practices-in-autoit/ Best Coding Practices In AutoIt [Forums&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Mdiesel|Mdiesel]] ([[User talk:Mdiesel|talk]]) 01:38, 7 January 2013 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Variable naming conventions ==&lt;br /&gt;
&lt;br /&gt;
The variable prefix system is only designed to be a recommendation. The idea is that variable naming should be something someone else can read and understand easily.&lt;br /&gt;
&lt;br /&gt;
A usage prefix is preferred to a type prefix. For example, dll struct strings are always prefixed $tag, rather than $s. If there is a logical usage prefix then it should be used rather than the type prefixes showed.&lt;br /&gt;
&lt;br /&gt;
There is also discussion about floats and boolean prefixes [http://www.autoitscript.com/forum/topic/146866-best-coding-practices-in-autoit/page__st__240#entry1072359 here].&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:Helpfile-Changes&amp;diff=11600</id>
		<title>Talk:Helpfile-Changes</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:Helpfile-Changes&amp;diff=11600"/>
		<updated>2013-02-14T12:54:48Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This page is just to keep track of all the large, and part-completed projects on the helpfile and UDFs.&lt;br /&gt;
&lt;br /&gt;
If you update an item on this page, there is a good chance the user concerned won&#039;t notice unless you pm them about it too.&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:Helpfile-Changes&amp;diff=11581</id>
		<title>Talk:Helpfile-Changes</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:Helpfile-Changes&amp;diff=11581"/>
		<updated>2013-01-31T03:04:21Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: Created page with &amp;quot; This page is just to keep track of all the large, and part-completed projects on the helpfile and UDFs.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This page is just to keep track of all the large, and part-completed projects on the helpfile and UDFs.&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Helpfile-Changes&amp;diff=11572</id>
		<title>Helpfile-Changes</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Helpfile-Changes&amp;diff=11572"/>
		<updated>2013-01-31T00:57:02Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: Created page with &amp;quot;This page is for keeping track of changes currently in the process of being made to the AutoIt3 helpfile and UDFs by the MVPs.  == Doc changes ==  * Shutdown parameter 2 (Mat)...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is for keeping track of changes currently in the process of being made to the AutoIt3 helpfile and UDFs by the MVPs.&lt;br /&gt;
&lt;br /&gt;
== Doc changes ==&lt;br /&gt;
&lt;br /&gt;
* Shutdown parameter 2 (Mat)&lt;br /&gt;
** Parameter meaning is too complex and not really usable. Suggested removing from docs completely.&lt;br /&gt;
&lt;br /&gt;
* Magic number removal (Mat)&lt;br /&gt;
** Document existing constants (in progress)&lt;br /&gt;
** Create new constants where required (making a list)&lt;br /&gt;
** Replace magic numbers in existing examples (Mat working on script to automate)&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/146560-report-help-file-issues-here/page__st__120#entry1048490 AZJIO post #135]&lt;br /&gt;
** RegRead type table (Mat), in progress&lt;br /&gt;
** IniRead return type (done)&lt;br /&gt;
** _ArrayDisplay $sheader (done in txtLibFunctions, not in UDF header)&lt;br /&gt;
** _GUICtrlComboBox_ReplaceEditSel&lt;br /&gt;
** _GUICtrlComboBox_ShowDropDown&lt;br /&gt;
** _GUICtrlComboBox_AddString&lt;br /&gt;
** _GUICtrlComboBox_SetCueBanner&lt;br /&gt;
&lt;br /&gt;
* General Example improvements&lt;br /&gt;
** Update examples to use multiple example functionality.&lt;br /&gt;
** Remove magic numbers!&lt;br /&gt;
** Make sure no permanent changes are made to system.&lt;br /&gt;
** Update examples to make use of new AutoIt features where appropriate.&lt;br /&gt;
&lt;br /&gt;
== UDF changes ==&lt;br /&gt;
&lt;br /&gt;
* Fixed buffer sizes (as per [http://www.autoitscript.com/forum/topic/147486-ticket-1336/ thread] and ticket 1336)&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/144746-winapiexau3-splitting-proposal/ WinAPIEx Splitting] (Jpm)&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=11571</id>
		<title>UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=11571"/>
		<updated>2013-01-29T23:43:33Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Basic Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:UDF]]&lt;br /&gt;
{{WIP}}This page is still under construction.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A library is a collection of one or more User Defined Functions (UDFs). However, the term UDF is often used to describe the collection as a whole. If a UDF is to be considered for inclusion in the standard set distributed with AutoIt then it must meet all the criteria detailed here, but it&#039;s also good practice to always write in conformance with at least the majority of this document, as that is what will be expected by people reading your code later.&lt;br /&gt;
&lt;br /&gt;
== Basic Requirements ==&lt;br /&gt;
Firstly, the code itself should meet the following basic requirements:&lt;br /&gt;
&lt;br /&gt;
* Be tidied. Just hit &amp;lt;code&amp;gt;Ctrl+T&amp;lt;/code&amp;gt; from SciTE or run Tidy manually. The only flag needed is &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Pass Au3Check with no errors using the strictest settings: &amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;&lt;br /&gt;
* Support everything AutoIt supports. In some cases features may not be able to support everything, in which case this should be checked for and return errors appropriately. This applies to: windows OS versions (AutoIt has support for all OS&#039; from windows 2000), unicode and ansi strings, 64 and 32 bit machines.&lt;br /&gt;
* Ideally it will be able to run cleanly when obfuscated. Although there will be some cases where this is not possible, please consider it when writing UDFs, and avoid the use of Execute and similar statements. If it does not, then document it as such.&lt;br /&gt;
* Not use any magic numbers. Ever. None. At all. No excuses.&lt;br /&gt;
&lt;br /&gt;
== UDF Outline ==&lt;br /&gt;
The library itself has a header that details important information such as the minimum OS and AutoIt versions, and what system dlls are required. There is also a number of other sections that are required that list what is present in the UDF.&lt;br /&gt;
&lt;br /&gt;
=== Includes ===&lt;br /&gt;
Since a UDF is designed to define functions, it should only be included once. As a result, the &amp;lt;code&amp;gt;#include-once&amp;lt;/code&amp;gt; directive should be used. This is typically the first line of the UDF, followed by the includes used by the UDF. Include statements should use the double quoted form, as the library is expected to work in the same directory as libraries it depends on. Non standard libraries can be used if necessary, but this should be documented and linked to so users can download it as well. It goes without saying that a UDF based on non-standard UDFs cannot itself become a standard.&lt;br /&gt;
&lt;br /&gt;
=== Index ===&lt;br /&gt;
The index follows the following template (taken from &amp;lt;code&amp;gt;WinAPI.au3&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: Windows API&lt;br /&gt;
; AutoIt Version : 3.2&lt;br /&gt;
; Description ...: Windows API calls that have been translated to AutoIt functions.&lt;br /&gt;
; Author(s) .....: Paul Campbell (PaulIA), gafrost, Siao, Zedna, arcker, Prog@ndy, PsaltyDS, Raik, jpm&lt;br /&gt;
; Dll ...........: kernel32.dll, user32.dll, gdi32.dll, comdlg32.dll, shell32.dll, ole32.dll, winspool.drv&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only required element in the index header is &amp;lt;code&amp;gt;Title&amp;lt;/code&amp;gt;. All others are ignored by the processor, but should be included for reference&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Dll&amp;lt;/code&amp;gt; field can remain empty in many cases where no dlls are called directly. This header must be defined.&lt;br /&gt;
&lt;br /&gt;
=== Other Sections ===&lt;br /&gt;
Other sections, in order of appearance, are as follows.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
All global variables needed to be declared in the UDF are defined in this section. They should follow the variable rules for globals. Individual variables do not need to be documented, as it is assumed they are for internal use only. Any globals designed to be accessible for the user should instead be wrapped by a function (or multiple functions if globals must be retrieved and set). The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #VARIABLES# ===================================================================================================================&lt;br /&gt;
Global $__gvMyGlobal = 0&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no globals are needed then this section may be ommitted. Please consider the use of global variables carefully, and read through the section on global variables.&lt;br /&gt;
&lt;br /&gt;
==== Constants ====&lt;br /&gt;
Any global constant values are defined in this section. This should be constants only designated for use within the library itself. Constants that may be needed by the user should be defined in a separate file, named &amp;lt;code&amp;gt;UDFConstants.au3&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;UDF&amp;lt;/code&amp;gt; is the name of the parent file. For example &amp;lt;code&amp;gt;File.au3&amp;lt;/code&amp;gt; uses constants defined in &amp;lt;code&amp;gt;FileConstants.au3&amp;lt;/code&amp;gt;. The exception to that rule is control UDFs which miss out the prepended &#039;GUI&#039; when naming constant files, so &amp;lt;code&amp;gt;GUIButton.au3&amp;lt;/code&amp;gt; uses constants from &amp;lt;code&amp;gt;ButtonConstants.au3&amp;lt;/code&amp;gt;. The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CONSTANTS# ===================================================================================================================&lt;br /&gt;
Global Const $__MYUDFCONSTANT_FOOBAR = 42&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no constants are needed in this section, either because none are used or because they are stored in a separate file, then it may be ommitted. Please read the section on global constants for specific info on naming and definition of constants.&lt;br /&gt;
&lt;br /&gt;
==== Listing ====&lt;br /&gt;
This defines all functions and structures currently used functions in the library. It MUST be the second defined header item after [[#Index]]. It is a simple list with each function on a line where the functions and structures appear in the same order as they do in the code, which is alphabetical order and structures first. A simple way to generate this list is to create a small script that searches for function definitions and outputs them in the correct format, an example of which is [http://www.autoitscript.com/forum/topic/120820-function-name-lister/ here]. In addition there is a second section that lists functions and structures for internal use only, this does not need to appear if none are defined.&lt;br /&gt;
&lt;br /&gt;
The template for these sections are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
;$tagINTERNALSTRUCT&lt;br /&gt;
;__MyUDF_InternalFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section still needs to be defined for files that only define constants. It should also be noted that there MUST NOT be a space between the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; and the function/structure name.&lt;br /&gt;
&lt;br /&gt;
==== Undocumented Listing ====&lt;br /&gt;
There is a final kind of listing that lists functions for which no documentation exists, or they have been deprecated and are only included for backwards compatibility. These are listed in a section with the header &amp;lt;code&amp;gt;NO_DOC_FUNCTION&amp;lt;/code&amp;gt;. This is very rarely used, and is reserved only for functions that can be utilised by the user, or that would have been in the past, as opposed to those for internal use only.&lt;br /&gt;
&lt;br /&gt;
Template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Renamed Functions ====&lt;br /&gt;
Although it should not be the case in new UDFs, many of the older ones (particularly to do with controls) have had script breaking name changes to functions. These are documented in the UDF to ensure updating old scripts is as easy as possible. The basic format for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_OldFunction                        ; --&amp;gt; _MyUDF_NewFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The space padding is optional. This section is ignored as far as the docs are concerned, and is usually omitted.&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
=== Naming ===&lt;br /&gt;
Function names must start with an underscore, and the first word is the library name. There is then usually another underscore before the rest of the function name. The library name should be consistent across all the functions in the library, and can be shortened if a logical abbreviation is available (e.g. &amp;lt;code&amp;gt;Window&amp;lt;/code&amp;gt; ==&amp;gt; &amp;lt;code&amp;gt;Win&amp;lt;/code&amp;gt;). Each word should be capitalized, but no underscores are placed in the rest of the name, for example &amp;lt;code&amp;gt;_WinAPI_GetWindowLong&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For control libraries, the first part of the function name is changed slightly. For example the UDF for listviews would use &amp;lt;code&amp;gt;_GUICtrlListview_*&amp;lt;/code&amp;gt;. When a function wraps a dll call, then the second part should closely resemble the function name as it appears in other languages. This also applies to functions acting as a wrapper to &amp;lt;code&amp;gt;SendMessage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Functions are defined in alphabetical order by name, which is the same as using &amp;lt;code&amp;gt;Tidy&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt; flag set.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
Parameters should follow the variable naming scheme ([[#Naming_2|here]]). All parameters must be checked to ensure they are valid, and return unique and documented error codes if they are not. For functions involving a specific type of control, this includes checking the class name using &amp;lt;code&amp;gt;_WinAPI_IsClassName&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parameters that are optional or byref should be documented as such, and the effect these have explicitly stated. For example a byref parameter should detail exactly what the expected output is as well as the input.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
All functions have a documentation header that describes the function. This uses the following template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _WinAPI_GetMousePos&lt;br /&gt;
; Description ...: Returns the current mouse position&lt;br /&gt;
; Syntax.........: _WinAPI_GetMousePos([$fToClient = False[, $hWnd = 0]])&lt;br /&gt;
; Parameters ....: $fToClient   - If True, the coordinates will be converted to client coordinates&lt;br /&gt;
;                  $hWnd        - Window handle used to convert coordinates if $fToClient is True&lt;br /&gt;
; Return values .: Success      - $tagPOINT structure with current mouse position&lt;br /&gt;
;                  Failure      - Zero&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......: This function takes into account the current MouseCoordMode setting when  obtaining  the  mouse  position.  It&lt;br /&gt;
;                  will also convert screen to client coordinates based on the parameters passed.&lt;br /&gt;
; Related .......: $tagPOINT, _WinAPI_GetMousePosX, _WinAPI_GetMousePosY&lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _WinAPI_GetMousePos($fToClient = False, $hWnd = 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The header is 129 characters wide, and any text within it should be wrapped to that length. For example the &amp;lt;code&amp;gt;Remarks&amp;lt;/code&amp;gt; in the above header has been extended to cover two lines. The exception to that rule is the &amp;lt;code&amp;gt;Syntax&amp;lt;/code&amp;gt; line, which should not be wrapped. Some of the parameters in the header are optional, in which case they should remain, but be left empty (for example the &amp;lt;code&amp;gt;Link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Modified&amp;lt;/code&amp;gt; lines in the above header). In others, they are needed, but can be empty or not used such as &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return Values&amp;lt;/code&amp;gt;. In this case the value should be &#039;None&#039;, as they will still be present in the documentation.&lt;br /&gt;
&lt;br /&gt;
There are some flags that can be used within function headers: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 20 is the continuation flag for the previous line (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; in column 20 is a new line in the right side of the table when the help file is generated (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;-&#039;&#039;&#039; in column 20 will create new row in the table, used for things like Defaults for a style (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 2 of Remarks is a blank line&lt;br /&gt;
Name&lt;br /&gt;
:Specifies the name of the function. This will be identical to how it appeas in the Func statement in the code itself.&lt;br /&gt;
Description&lt;br /&gt;
:Gives a short summary of what the function does. This should only be a single line, as it is only designed to give a short impression of what is happening. For the standard set of includes distributed with AutoIt3, this value is also used in the SciTE calltips.&lt;br /&gt;
Syntax&lt;br /&gt;
:Describes the syntax of the function call. This differs slightly from what appears in the code itself for optional parameters, which are enclosed in square brackets (&amp;quot;[ ]&amp;quot;). Since subsequent parameters must also be optional, and cannot be defined unless all the previous ones have been given, these brackets are nested in the form: Function([param1[, param2[,param3]]]). Note that the opening bracket appears before the comma seperator.&lt;br /&gt;
Parameters&lt;br /&gt;
:This is a list of the arguments accepted by the function. Each is listed, followed by a dash (&amp;quot;-&amp;quot;) and a description of what it is. The dash can be padded for neatness, although the amount of padding depends on how long the parameter names are. If the parameter is optional then the meaning of the default value should be given, similarly if it&#039;s used to pass data back to the program in the form of byref then the changes made should also be detailed. For more information on parameters see Parameters.&lt;br /&gt;
Return values&lt;br /&gt;
:Details what is returned by the function. This often comes in the form of Success and Failure values, but this is not always the case. Any setting of the @error of @extended flags should be detailed, along with their meanings, in some cases it is enough to say that @error is set to non-zero in the event of an error, in most cases though a list of values for @error should be given.&lt;br /&gt;
Author&lt;br /&gt;
:This is the original writer of the function. It should contain the username, so that any queries about the code can be made through the forum, but you can give as much or little information as you feel appropriate.&lt;br /&gt;
Modified&lt;br /&gt;
:This is a list of modifications made. At it&#039;s most basic this is just a list of users who have made changes, but ideally it includes some information about what they did, in which cases it follows the same form as other multi-value lines, with the username and description of modifications seperated by a dash.&lt;br /&gt;
Remarks&lt;br /&gt;
:This is anything the user should know about a function in order to use it. For example exceptional cases and recommended ways to handle the function should all be detailed here, as well as additional info about possible reasons for failure and how to deal with them.&lt;br /&gt;
Related&lt;br /&gt;
:A comma seperated list of functions or structures related to the function.&lt;br /&gt;
Link&lt;br /&gt;
:A link to additional information about the function. For many system function wrappers, this will be &amp;lt;code&amp;gt;@@MsdnLink@@ FunctionName&amp;lt;/code&amp;gt;, which represents that the user should search MSDN for the function.&lt;br /&gt;
Example&lt;br /&gt;
:A simple yes or no value specifying whether the function has an example. If this is no then your UDF is not ready to be released. The [[#Examples]] section has more information on the format and location of examples.&lt;br /&gt;
&lt;br /&gt;
The easiest way to generate the header is to copy and paste the following blank template in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also a number of plugins for SciTE that will generate a header and maybe fill in certain known values for you such as Name, Syntax and Parameters. The most complete one that conforms to these standards is [http://code.google.com/p/m-a-t/wiki/UDFHeaderGenerator here], but there are two others [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/ here] and [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/page__view__findpost__p__200823 here].&lt;br /&gt;
&lt;br /&gt;
=== Internal use only ===&lt;br /&gt;
Functions can also be marked for use only within the library and not to be documented for use by the user. These are named according to the same rules as normal functions but begin with a double underscore (&amp;quot;__&amp;quot;). The header is exactly the same except with the first line replaced, to make the blank template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structures ==&lt;br /&gt;
Structures are defined as global constants, and follow the naming pattern &amp;lt;code&amp;gt;$tagSTRUCTNAME&amp;lt;/code&amp;gt;. The struct name should be as it appears on MSDN if it&#039;s used in the windows API, or follow a similar pattern if not. It should go without saying that they must work for both 32 and 64 bit machines, including resolving any alignment issues. Elements should also be named as they appear on MSDN if they are taken from there, which includes the hungarian notation prefix. Although many standard UDFs do not follow that rule, importantly &amp;lt;code&amp;gt;StructureConstants.au3&amp;lt;/code&amp;gt;, the rule still stands.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
Structures need a header similar to functions, but with some minor differences. The same rules apply in terms of wrapping and line length however. The header follow this standard template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagPOINT&lt;br /&gt;
; Description ...: Defines the x and y coordinates of a point&lt;br /&gt;
; Fields ........: X - Specifies the x-coordinate of the point&lt;br /&gt;
;                  Y - Specifies the y-coordinate of the point&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagPOINT = &amp;quot;long X;long Y&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is essentially a shortened header, with the only thing new is the Fields line, which effectively replaces the Parameters field in terms of usage. All the same rules apply as listed [[#Function Header Fields|here]].&lt;br /&gt;
&lt;br /&gt;
The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Structures may also be marked for internal use only. In this case the header ramains the same, but the sections first line changes. The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
For code readability, there are special rules dealing with variables, particularly naming. All variables should be declared at the beginning of their scope, which usually means at the start of the function in which they are used, but could mean the top of the UDF itself in the [[#Variables|Variables section]].&lt;br /&gt;
&lt;br /&gt;
=== Naming ===&lt;br /&gt;
A variable&#039;s first letter signifies the expected type of the variable. This should be as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$a&amp;amp;lt;letter&amp;amp;gt;&amp;lt;/code&amp;gt; - Array (the following letter describes the data type taken from the rest of the data types below, if it varies then &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; should be used. A counter as the first element is ignored, so the array returned by StringSplit (with default options) would actually be marked as $as despite the integer in the zeroeth element).&lt;br /&gt;
* &amp;lt;code&amp;gt;$d&amp;lt;/code&amp;gt; - Binary data.&lt;br /&gt;
* &amp;lt;code&amp;gt;$h&amp;lt;/code&amp;gt; - Handle, usually to a file or window. NB: AutoIt handled controls return IDs, and so use $id instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt; - An AutoIt control Id.&lt;br /&gt;
* &amp;lt;code&amp;gt;$i&amp;lt;/code&amp;gt; - Integer.&lt;br /&gt;
* &amp;lt;code&amp;gt;$b&amp;lt;/code&amp;gt; - Boolean.&lt;br /&gt;
* &amp;lt;code&amp;gt;$f&amp;lt;/code&amp;gt; - Floating point number.&lt;br /&gt;
* &amp;lt;code&amp;gt;$n&amp;lt;/code&amp;gt; - general number with no preference for floating point or integer.&lt;br /&gt;
* &amp;lt;code&amp;gt;$s&amp;lt;/code&amp;gt; - String.&lt;br /&gt;
* &amp;lt;code&amp;gt;$v&amp;lt;/code&amp;gt; - Variant (unknown/variable type of data) .&lt;br /&gt;
* &amp;lt;code&amp;gt;$p&amp;lt;/code&amp;gt; - Pointer. It is assumed that it points to a struct so no further letters are needed. The type of struct being pointed to should be inferrable from the variable name e.g. &amp;lt;code&amp;gt;$pWindowRect&amp;lt;/code&amp;gt; can be assumed to be a pointer to a &amp;lt;code&amp;gt;$tagRECT&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;$t&amp;lt;/code&amp;gt; - Structure returned from DllStructCreate.&lt;br /&gt;
* &amp;lt;code&amp;gt;$tag&amp;lt;/code&amp;gt; - Struct definition string.Structure definitions should conform to the structure guidelines.&lt;br /&gt;
&lt;br /&gt;
=== Globals ===&lt;br /&gt;
The use of globals in a UDF is generally frowned upon, and byref parameters and static variables should be used where possible instead. However, in cases where this is not possible and a global must be used they should be defined using the following naming pattern: &amp;lt;code&amp;gt;$__g&amp;amp;lt;VARNAME&amp;amp;gt;_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;&amp;amp;lt;VARNAME&amp;amp;gt;&amp;lt;/code&amp;gt; is the name as it would usually appear according to the variable naming rules above and &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; is the name of the library in which it appears. This ensures there will never be a conflict with user variables of other UDF globals. They should be declared at the top of the UDF in the Variables section.&lt;br /&gt;
&lt;br /&gt;
Globals are always private. If they need to be accessed by the user then functions need to be written wrapping that operation and values should be checked. Notable exceptions are debug variables, which are designed for developer purposes and may be used by some users in extreme cases. These are named &amp;lt;code&amp;gt;$Debug_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; although the &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; part is often shortened so &amp;lt;code&amp;gt;GUIEdit.au3&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;$Debug_Ed&amp;lt;/code&amp;gt;. It is not required that a UDF has debugging symbols, but they are allowed to remain in releases.&lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
There are two types of constants, internal and public. Public constants are designed to be utilised by the user, and are referenced in functions that use them. They include styles and flags. Internal constants are designed for use only within the library, so that values used fairly often can be held in one place to allow for easy updating. Both kinds of constant are always typed in all upper case. Constants taken from the windows API should appear exactly as they are defined there, but internal constants follow the naming pattern: &amp;lt;code&amp;gt;$__&amp;amp;lt;UDF&amp;amp;gt;CONSTANT_&amp;amp;lt;NAME&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;lt;code&amp;gt;Dim&amp;lt;/code&amp;gt; statement ===&lt;br /&gt;
Should not be used.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
All functions and structures that are made public to the user need to have a good quality example. This means that it should:&lt;br /&gt;
&lt;br /&gt;
* Be simple. Ideally the only functions used are basic functions like ConsoleWrite and MsgBox and the function that the example is written for. Writing a single example that covers a wide range of functions is not nearly as easy to use as writing an example per function that clearly demonstrates its use.&lt;br /&gt;
* Be readable. Everything should be explained step by step in comments.&lt;br /&gt;
* Be correct. In addition to passing the same Au3Check flags as the UDF itself (&amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;) it should always be written with best practice being the main consideration. This takes preference over the first point, just because code is shorter and looks easier doesn&#039;t mean it&#039;s right.&lt;br /&gt;
* Examples should represent all the functionality. If there is more than one way of using a function then include more than one example of how to use it.&lt;br /&gt;
* Not make any permanent changes to the users computer. For example, if demonstrating a File function, be sure to delete the file after it has been used. The same applies for any function that makes a change to the environment: the changes MUST be undone.&lt;br /&gt;
&lt;br /&gt;
Always remember, the readability of code in an example is MORE important than the readability of code inside the UDF itself.&lt;br /&gt;
&lt;br /&gt;
Examples are stored in script files called &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;.au3&amp;lt;/code&amp;gt;. The files should be kept in a folder called &amp;lt;code&amp;gt;Examples&amp;lt;/code&amp;gt;. To remain correct all examples should be wrapped in functions, such that the only code executed in the global scope is calling the function. This is usually named &amp;lt;code&amp;gt;Example&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $idButton_1, $idButton_2, $iMsg, $hGUI&lt;br /&gt;
	&lt;br /&gt;
	$hGUI = GUICreate(&amp;quot;My GUI Button&amp;quot;) ; Will create a dialog box that when displayed is centered&lt;br /&gt;
&lt;br /&gt;
	$idButton_1 = GUICtrlCreateButton(&amp;quot;Run Notepad&amp;quot;, 4, 4, 80, 30)&lt;br /&gt;
	$idButton_2 = GUICtrlCreateButton(&amp;quot;Button Test&amp;quot;, 4, 38, 80, 30)&lt;br /&gt;
&lt;br /&gt;
	GUISetState() ; will display a dialog box with 2 button&lt;br /&gt;
&lt;br /&gt;
	; Run the GUI until the dialog is closed&lt;br /&gt;
	While 1&lt;br /&gt;
		$iMsg = GUIGetMsg()&lt;br /&gt;
		Select&lt;br /&gt;
			Case $iMsg = $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			Case $iMsg = $idButton_1&lt;br /&gt;
				Run(&amp;quot;Notepad.exe&amp;quot;) ; Will Run/Open Notepad&lt;br /&gt;
			Case $iMsg = $idButton_2&lt;br /&gt;
				MsgBox($MB_SYSTEMMODAL, &amp;quot;Testing&amp;quot;, &amp;quot;Button 2 was pressed&amp;quot;) ; Will demonstrate Button 2 being pressed&lt;br /&gt;
		EndSelect&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multiple Examples ===&lt;br /&gt;
The helpfile now supports multiple examples per function. In order to maintain backwards compatibility with any other tools that use examples, the first file is still named &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;.au3&amp;lt;/code&amp;gt;, but any additional examples are named &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;[n].au3&amp;lt;/code&amp;gt; where n is an integer counter starting at 2.&lt;br /&gt;
&lt;br /&gt;
== Template UDF ==&lt;br /&gt;
Here is an example of a UDF called &amp;lt;code&amp;gt;MyUDF.au3&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include-once&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;MyUDFConstants.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;AnInclude.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: MyUDF&lt;br /&gt;
; AutoIt Version : 3.3.6.1&lt;br /&gt;
; Language ......: English&lt;br /&gt;
; Description ...: An example UDF that does very little.&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagMYSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagMYSTRUCT&lt;br /&gt;
; Description ...: An example of a structure.&lt;br /&gt;
; Fields ........: hFoo       - A handle to foo that does something.&lt;br /&gt;
;                  iBar       - An integer that does something.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: _MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagMYSTRUCT = &amp;quot;ptr hFoo; int iBar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _MyUDF_Function&lt;br /&gt;
; Description ...: A function that does something.&lt;br /&gt;
; Syntax.........: _MyUDF_Function(ByRef $avAnArray, $iAnInt[, $hAHandle = 0[, $nSomeNumber = 42]])&lt;br /&gt;
; Parameters ....: $avAnArray       - [byref] An array of anything. The value of anything is changed and passed out using this&lt;br /&gt;
;                                     parameter. The array should only have one dimension&lt;br /&gt;
;                  $iAnInt          - An integer that does very little.&lt;br /&gt;
;                  $hAHandle        - [optional] A handle. Default is zero.&lt;br /&gt;
;                  $nSomeNumber     - [optional] A number of some kind. Default is 42.&lt;br /&gt;
; Return values .: Success          - A MYSTRUCT structure.&lt;br /&gt;
;                  Failure          - Returns zero and sets the @error flag:&lt;br /&gt;
;                                   |1 - The $avAnArray is invalid.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: $tagMYSTRUCT&lt;br /&gt;
; Link ..........:&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _MyUDF_Function(ByRef $avAnArray, $iAnInt, $hAHandle = 0, $nSomeNumber = 42)&lt;br /&gt;
	; 1 - Error Checking for parameters.&lt;br /&gt;
	If Not IsArray($avAnArray) Or UBound($avAnArray, 0) &amp;lt;&amp;gt; 1 Then Return SetError(1, 0, 0) ; The $avAnArray is invalid.&lt;br /&gt;
&lt;br /&gt;
	; 2 - Declaration of locals.&lt;br /&gt;
	Local $tMS = DllStructCreate($tagMYSTRUCT)&lt;br /&gt;
&lt;br /&gt;
	; 3 - Function code&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;hFoo&amp;quot;, $hAHandle)&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;iBar&amp;quot;, $iAnInt * $nSomeNumber)&lt;br /&gt;
&lt;br /&gt;
	Return $tMS&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyUDF_Function&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=11570</id>
		<title>UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=11570"/>
		<updated>2013-01-29T23:42:21Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:UDF]]&lt;br /&gt;
{{WIP}}This page is still under construction.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A library is a collection of one or more User Defined Functions (UDFs). However, the term UDF is often used to describe the collection as a whole. If a UDF is to be considered for inclusion in the standard set distributed with AutoIt then it must meet all the criteria detailed here, but it&#039;s also good practice to always write in conformance with at least the majority of this document, as that is what will be expected by people reading your code later.&lt;br /&gt;
&lt;br /&gt;
== Basic Requirements ==&lt;br /&gt;
Firstly, the code itself should meet the following basic requirements:&lt;br /&gt;
&lt;br /&gt;
* Be tidied. Just hit &amp;lt;code&amp;gt;Ctrl+T&amp;lt;/code&amp;gt; from SciTE or run Tidy manually. The only flag needed is &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Pass Au3Check with no errors using the strictest settings: &amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;&lt;br /&gt;
* Support everything AutoIt supports. In some cases features may not be able to support everything, in which case this should be checked for and return errors appropriately. This applies to: windows OS versions (AutoIt has support for all OS&#039; from windows 2000), unicode and ansi strings, 64 and 32 bit machines.&lt;br /&gt;
* Ideally it will be able to run cleanly when obfuscated. Although there will be some cases where this is not possible, please consider it when writing UDFs, and avoid the use of Execute and similar statements. If it does not, then document it as such.&lt;br /&gt;
&lt;br /&gt;
== UDF Outline ==&lt;br /&gt;
The library itself has a header that details important information such as the minimum OS and AutoIt versions, and what system dlls are required. There is also a number of other sections that are required that list what is present in the UDF.&lt;br /&gt;
&lt;br /&gt;
=== Includes ===&lt;br /&gt;
Since a UDF is designed to define functions, it should only be included once. As a result, the &amp;lt;code&amp;gt;#include-once&amp;lt;/code&amp;gt; directive should be used. This is typically the first line of the UDF, followed by the includes used by the UDF. Include statements should use the double quoted form, as the library is expected to work in the same directory as libraries it depends on. Non standard libraries can be used if necessary, but this should be documented and linked to so users can download it as well. It goes without saying that a UDF based on non-standard UDFs cannot itself become a standard.&lt;br /&gt;
&lt;br /&gt;
=== Index ===&lt;br /&gt;
The index follows the following template (taken from &amp;lt;code&amp;gt;WinAPI.au3&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: Windows API&lt;br /&gt;
; AutoIt Version : 3.2&lt;br /&gt;
; Description ...: Windows API calls that have been translated to AutoIt functions.&lt;br /&gt;
; Author(s) .....: Paul Campbell (PaulIA), gafrost, Siao, Zedna, arcker, Prog@ndy, PsaltyDS, Raik, jpm&lt;br /&gt;
; Dll ...........: kernel32.dll, user32.dll, gdi32.dll, comdlg32.dll, shell32.dll, ole32.dll, winspool.drv&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only required element in the index header is &amp;lt;code&amp;gt;Title&amp;lt;/code&amp;gt;. All others are ignored by the processor, but should be included for reference&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Dll&amp;lt;/code&amp;gt; field can remain empty in many cases where no dlls are called directly. This header must be defined.&lt;br /&gt;
&lt;br /&gt;
=== Other Sections ===&lt;br /&gt;
Other sections, in order of appearance, are as follows.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
All global variables needed to be declared in the UDF are defined in this section. They should follow the variable rules for globals. Individual variables do not need to be documented, as it is assumed they are for internal use only. Any globals designed to be accessible for the user should instead be wrapped by a function (or multiple functions if globals must be retrieved and set). The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #VARIABLES# ===================================================================================================================&lt;br /&gt;
Global $__gvMyGlobal = 0&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no globals are needed then this section may be ommitted. Please consider the use of global variables carefully, and read through the section on global variables.&lt;br /&gt;
&lt;br /&gt;
==== Constants ====&lt;br /&gt;
Any global constant values are defined in this section. This should be constants only designated for use within the library itself. Constants that may be needed by the user should be defined in a separate file, named &amp;lt;code&amp;gt;UDFConstants.au3&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;UDF&amp;lt;/code&amp;gt; is the name of the parent file. For example &amp;lt;code&amp;gt;File.au3&amp;lt;/code&amp;gt; uses constants defined in &amp;lt;code&amp;gt;FileConstants.au3&amp;lt;/code&amp;gt;. The exception to that rule is control UDFs which miss out the prepended &#039;GUI&#039; when naming constant files, so &amp;lt;code&amp;gt;GUIButton.au3&amp;lt;/code&amp;gt; uses constants from &amp;lt;code&amp;gt;ButtonConstants.au3&amp;lt;/code&amp;gt;. The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CONSTANTS# ===================================================================================================================&lt;br /&gt;
Global Const $__MYUDFCONSTANT_FOOBAR = 42&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no constants are needed in this section, either because none are used or because they are stored in a separate file, then it may be ommitted. Please read the section on global constants for specific info on naming and definition of constants.&lt;br /&gt;
&lt;br /&gt;
==== Listing ====&lt;br /&gt;
This defines all functions and structures currently used functions in the library. It MUST be the second defined header item after [[#Index]]. It is a simple list with each function on a line where the functions and structures appear in the same order as they do in the code, which is alphabetical order and structures first. A simple way to generate this list is to create a small script that searches for function definitions and outputs them in the correct format, an example of which is [http://www.autoitscript.com/forum/topic/120820-function-name-lister/ here]. In addition there is a second section that lists functions and structures for internal use only, this does not need to appear if none are defined.&lt;br /&gt;
&lt;br /&gt;
The template for these sections are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
;$tagINTERNALSTRUCT&lt;br /&gt;
;__MyUDF_InternalFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section still needs to be defined for files that only define constants. It should also be noted that there MUST NOT be a space between the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; and the function/structure name.&lt;br /&gt;
&lt;br /&gt;
==== Undocumented Listing ====&lt;br /&gt;
There is a final kind of listing that lists functions for which no documentation exists, or they have been deprecated and are only included for backwards compatibility. These are listed in a section with the header &amp;lt;code&amp;gt;NO_DOC_FUNCTION&amp;lt;/code&amp;gt;. This is very rarely used, and is reserved only for functions that can be utilised by the user, or that would have been in the past, as opposed to those for internal use only.&lt;br /&gt;
&lt;br /&gt;
Template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Renamed Functions ====&lt;br /&gt;
Although it should not be the case in new UDFs, many of the older ones (particularly to do with controls) have had script breaking name changes to functions. These are documented in the UDF to ensure updating old scripts is as easy as possible. The basic format for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_OldFunction                        ; --&amp;gt; _MyUDF_NewFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The space padding is optional. This section is ignored as far as the docs are concerned, and is usually omitted.&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
=== Naming ===&lt;br /&gt;
Function names must start with an underscore, and the first word is the library name. There is then usually another underscore before the rest of the function name. The library name should be consistent across all the functions in the library, and can be shortened if a logical abbreviation is available (e.g. &amp;lt;code&amp;gt;Window&amp;lt;/code&amp;gt; ==&amp;gt; &amp;lt;code&amp;gt;Win&amp;lt;/code&amp;gt;). Each word should be capitalized, but no underscores are placed in the rest of the name, for example &amp;lt;code&amp;gt;_WinAPI_GetWindowLong&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For control libraries, the first part of the function name is changed slightly. For example the UDF for listviews would use &amp;lt;code&amp;gt;_GUICtrlListview_*&amp;lt;/code&amp;gt;. When a function wraps a dll call, then the second part should closely resemble the function name as it appears in other languages. This also applies to functions acting as a wrapper to &amp;lt;code&amp;gt;SendMessage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Functions are defined in alphabetical order by name, which is the same as using &amp;lt;code&amp;gt;Tidy&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt; flag set.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
Parameters should follow the variable naming scheme ([[#Naming_2|here]]). All parameters must be checked to ensure they are valid, and return unique and documented error codes if they are not. For functions involving a specific type of control, this includes checking the class name using &amp;lt;code&amp;gt;_WinAPI_IsClassName&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parameters that are optional or byref should be documented as such, and the effect these have explicitly stated. For example a byref parameter should detail exactly what the expected output is as well as the input.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
All functions have a documentation header that describes the function. This uses the following template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _WinAPI_GetMousePos&lt;br /&gt;
; Description ...: Returns the current mouse position&lt;br /&gt;
; Syntax.........: _WinAPI_GetMousePos([$fToClient = False[, $hWnd = 0]])&lt;br /&gt;
; Parameters ....: $fToClient   - If True, the coordinates will be converted to client coordinates&lt;br /&gt;
;                  $hWnd        - Window handle used to convert coordinates if $fToClient is True&lt;br /&gt;
; Return values .: Success      - $tagPOINT structure with current mouse position&lt;br /&gt;
;                  Failure      - Zero&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......: This function takes into account the current MouseCoordMode setting when  obtaining  the  mouse  position.  It&lt;br /&gt;
;                  will also convert screen to client coordinates based on the parameters passed.&lt;br /&gt;
; Related .......: $tagPOINT, _WinAPI_GetMousePosX, _WinAPI_GetMousePosY&lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _WinAPI_GetMousePos($fToClient = False, $hWnd = 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The header is 129 characters wide, and any text within it should be wrapped to that length. For example the &amp;lt;code&amp;gt;Remarks&amp;lt;/code&amp;gt; in the above header has been extended to cover two lines. The exception to that rule is the &amp;lt;code&amp;gt;Syntax&amp;lt;/code&amp;gt; line, which should not be wrapped. Some of the parameters in the header are optional, in which case they should remain, but be left empty (for example the &amp;lt;code&amp;gt;Link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Modified&amp;lt;/code&amp;gt; lines in the above header). In others, they are needed, but can be empty or not used such as &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return Values&amp;lt;/code&amp;gt;. In this case the value should be &#039;None&#039;, as they will still be present in the documentation.&lt;br /&gt;
&lt;br /&gt;
There are some flags that can be used within function headers: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 20 is the continuation flag for the previous line (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; in column 20 is a new line in the right side of the table when the help file is generated (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;-&#039;&#039;&#039; in column 20 will create new row in the table, used for things like Defaults for a style (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 2 of Remarks is a blank line&lt;br /&gt;
Name&lt;br /&gt;
:Specifies the name of the function. This will be identical to how it appeas in the Func statement in the code itself.&lt;br /&gt;
Description&lt;br /&gt;
:Gives a short summary of what the function does. This should only be a single line, as it is only designed to give a short impression of what is happening. For the standard set of includes distributed with AutoIt3, this value is also used in the SciTE calltips.&lt;br /&gt;
Syntax&lt;br /&gt;
:Describes the syntax of the function call. This differs slightly from what appears in the code itself for optional parameters, which are enclosed in square brackets (&amp;quot;[ ]&amp;quot;). Since subsequent parameters must also be optional, and cannot be defined unless all the previous ones have been given, these brackets are nested in the form: Function([param1[, param2[,param3]]]). Note that the opening bracket appears before the comma seperator.&lt;br /&gt;
Parameters&lt;br /&gt;
:This is a list of the arguments accepted by the function. Each is listed, followed by a dash (&amp;quot;-&amp;quot;) and a description of what it is. The dash can be padded for neatness, although the amount of padding depends on how long the parameter names are. If the parameter is optional then the meaning of the default value should be given, similarly if it&#039;s used to pass data back to the program in the form of byref then the changes made should also be detailed. For more information on parameters see Parameters.&lt;br /&gt;
Return values&lt;br /&gt;
:Details what is returned by the function. This often comes in the form of Success and Failure values, but this is not always the case. Any setting of the @error of @extended flags should be detailed, along with their meanings, in some cases it is enough to say that @error is set to non-zero in the event of an error, in most cases though a list of values for @error should be given.&lt;br /&gt;
Author&lt;br /&gt;
:This is the original writer of the function. It should contain the username, so that any queries about the code can be made through the forum, but you can give as much or little information as you feel appropriate.&lt;br /&gt;
Modified&lt;br /&gt;
:This is a list of modifications made. At it&#039;s most basic this is just a list of users who have made changes, but ideally it includes some information about what they did, in which cases it follows the same form as other multi-value lines, with the username and description of modifications seperated by a dash.&lt;br /&gt;
Remarks&lt;br /&gt;
:This is anything the user should know about a function in order to use it. For example exceptional cases and recommended ways to handle the function should all be detailed here, as well as additional info about possible reasons for failure and how to deal with them.&lt;br /&gt;
Related&lt;br /&gt;
:A comma seperated list of functions or structures related to the function.&lt;br /&gt;
Link&lt;br /&gt;
:A link to additional information about the function. For many system function wrappers, this will be &amp;lt;code&amp;gt;@@MsdnLink@@ FunctionName&amp;lt;/code&amp;gt;, which represents that the user should search MSDN for the function.&lt;br /&gt;
Example&lt;br /&gt;
:A simple yes or no value specifying whether the function has an example. If this is no then your UDF is not ready to be released. The [[#Examples]] section has more information on the format and location of examples.&lt;br /&gt;
&lt;br /&gt;
The easiest way to generate the header is to copy and paste the following blank template in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also a number of plugins for SciTE that will generate a header and maybe fill in certain known values for you such as Name, Syntax and Parameters. The most complete one that conforms to these standards is [http://code.google.com/p/m-a-t/wiki/UDFHeaderGenerator here], but there are two others [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/ here] and [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/page__view__findpost__p__200823 here].&lt;br /&gt;
&lt;br /&gt;
=== Internal use only ===&lt;br /&gt;
Functions can also be marked for use only within the library and not to be documented for use by the user. These are named according to the same rules as normal functions but begin with a double underscore (&amp;quot;__&amp;quot;). The header is exactly the same except with the first line replaced, to make the blank template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structures ==&lt;br /&gt;
Structures are defined as global constants, and follow the naming pattern &amp;lt;code&amp;gt;$tagSTRUCTNAME&amp;lt;/code&amp;gt;. The struct name should be as it appears on MSDN if it&#039;s used in the windows API, or follow a similar pattern if not. It should go without saying that they must work for both 32 and 64 bit machines, including resolving any alignment issues. Elements should also be named as they appear on MSDN if they are taken from there, which includes the hungarian notation prefix. Although many standard UDFs do not follow that rule, importantly &amp;lt;code&amp;gt;StructureConstants.au3&amp;lt;/code&amp;gt;, the rule still stands.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
Structures need a header similar to functions, but with some minor differences. The same rules apply in terms of wrapping and line length however. The header follow this standard template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagPOINT&lt;br /&gt;
; Description ...: Defines the x and y coordinates of a point&lt;br /&gt;
; Fields ........: X - Specifies the x-coordinate of the point&lt;br /&gt;
;                  Y - Specifies the y-coordinate of the point&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagPOINT = &amp;quot;long X;long Y&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is essentially a shortened header, with the only thing new is the Fields line, which effectively replaces the Parameters field in terms of usage. All the same rules apply as listed [[#Function Header Fields|here]].&lt;br /&gt;
&lt;br /&gt;
The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Structures may also be marked for internal use only. In this case the header ramains the same, but the sections first line changes. The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
For code readability, there are special rules dealing with variables, particularly naming. All variables should be declared at the beginning of their scope, which usually means at the start of the function in which they are used, but could mean the top of the UDF itself in the [[#Variables|Variables section]].&lt;br /&gt;
&lt;br /&gt;
=== Naming ===&lt;br /&gt;
A variable&#039;s first letter signifies the expected type of the variable. This should be as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$a&amp;amp;lt;letter&amp;amp;gt;&amp;lt;/code&amp;gt; - Array (the following letter describes the data type taken from the rest of the data types below, if it varies then &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; should be used. A counter as the first element is ignored, so the array returned by StringSplit (with default options) would actually be marked as $as despite the integer in the zeroeth element).&lt;br /&gt;
* &amp;lt;code&amp;gt;$d&amp;lt;/code&amp;gt; - Binary data.&lt;br /&gt;
* &amp;lt;code&amp;gt;$h&amp;lt;/code&amp;gt; - Handle, usually to a file or window. NB: AutoIt handled controls return IDs, and so use $id instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt; - An AutoIt control Id.&lt;br /&gt;
* &amp;lt;code&amp;gt;$i&amp;lt;/code&amp;gt; - Integer.&lt;br /&gt;
* &amp;lt;code&amp;gt;$b&amp;lt;/code&amp;gt; - Boolean.&lt;br /&gt;
* &amp;lt;code&amp;gt;$f&amp;lt;/code&amp;gt; - Floating point number.&lt;br /&gt;
* &amp;lt;code&amp;gt;$n&amp;lt;/code&amp;gt; - general number with no preference for floating point or integer.&lt;br /&gt;
* &amp;lt;code&amp;gt;$s&amp;lt;/code&amp;gt; - String.&lt;br /&gt;
* &amp;lt;code&amp;gt;$v&amp;lt;/code&amp;gt; - Variant (unknown/variable type of data) .&lt;br /&gt;
* &amp;lt;code&amp;gt;$p&amp;lt;/code&amp;gt; - Pointer. It is assumed that it points to a struct so no further letters are needed. The type of struct being pointed to should be inferrable from the variable name e.g. &amp;lt;code&amp;gt;$pWindowRect&amp;lt;/code&amp;gt; can be assumed to be a pointer to a &amp;lt;code&amp;gt;$tagRECT&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;$t&amp;lt;/code&amp;gt; - Structure returned from DllStructCreate.&lt;br /&gt;
* &amp;lt;code&amp;gt;$tag&amp;lt;/code&amp;gt; - Struct definition string.Structure definitions should conform to the structure guidelines.&lt;br /&gt;
&lt;br /&gt;
=== Globals ===&lt;br /&gt;
The use of globals in a UDF is generally frowned upon, and byref parameters and static variables should be used where possible instead. However, in cases where this is not possible and a global must be used they should be defined using the following naming pattern: &amp;lt;code&amp;gt;$__g&amp;amp;lt;VARNAME&amp;amp;gt;_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;&amp;amp;lt;VARNAME&amp;amp;gt;&amp;lt;/code&amp;gt; is the name as it would usually appear according to the variable naming rules above and &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; is the name of the library in which it appears. This ensures there will never be a conflict with user variables of other UDF globals. They should be declared at the top of the UDF in the Variables section.&lt;br /&gt;
&lt;br /&gt;
Globals are always private. If they need to be accessed by the user then functions need to be written wrapping that operation and values should be checked. Notable exceptions are debug variables, which are designed for developer purposes and may be used by some users in extreme cases. These are named &amp;lt;code&amp;gt;$Debug_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; although the &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; part is often shortened so &amp;lt;code&amp;gt;GUIEdit.au3&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;$Debug_Ed&amp;lt;/code&amp;gt;. It is not required that a UDF has debugging symbols, but they are allowed to remain in releases.&lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
There are two types of constants, internal and public. Public constants are designed to be utilised by the user, and are referenced in functions that use them. They include styles and flags. Internal constants are designed for use only within the library, so that values used fairly often can be held in one place to allow for easy updating. Both kinds of constant are always typed in all upper case. Constants taken from the windows API should appear exactly as they are defined there, but internal constants follow the naming pattern: &amp;lt;code&amp;gt;$__&amp;amp;lt;UDF&amp;amp;gt;CONSTANT_&amp;amp;lt;NAME&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;lt;code&amp;gt;Dim&amp;lt;/code&amp;gt; statement ===&lt;br /&gt;
Should not be used.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
All functions and structures that are made public to the user need to have a good quality example. This means that it should:&lt;br /&gt;
&lt;br /&gt;
* Be simple. Ideally the only functions used are basic functions like ConsoleWrite and MsgBox and the function that the example is written for. Writing a single example that covers a wide range of functions is not nearly as easy to use as writing an example per function that clearly demonstrates its use.&lt;br /&gt;
* Be readable. Everything should be explained step by step in comments.&lt;br /&gt;
* Be correct. In addition to passing the same Au3Check flags as the UDF itself (&amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;) it should always be written with best practice being the main consideration. This takes preference over the first point, just because code is shorter and looks easier doesn&#039;t mean it&#039;s right.&lt;br /&gt;
* Examples should represent all the functionality. If there is more than one way of using a function then include more than one example of how to use it.&lt;br /&gt;
* Not make any permanent changes to the users computer. For example, if demonstrating a File function, be sure to delete the file after it has been used. The same applies for any function that makes a change to the environment: the changes MUST be undone.&lt;br /&gt;
&lt;br /&gt;
Always remember, the readability of code in an example is MORE important than the readability of code inside the UDF itself.&lt;br /&gt;
&lt;br /&gt;
Examples are stored in script files called &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;.au3&amp;lt;/code&amp;gt;. The files should be kept in a folder called &amp;lt;code&amp;gt;Examples&amp;lt;/code&amp;gt;. To remain correct all examples should be wrapped in functions, such that the only code executed in the global scope is calling the function. This is usually named &amp;lt;code&amp;gt;Example&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $idButton_1, $idButton_2, $iMsg, $hGUI&lt;br /&gt;
	&lt;br /&gt;
	$hGUI = GUICreate(&amp;quot;My GUI Button&amp;quot;) ; Will create a dialog box that when displayed is centered&lt;br /&gt;
&lt;br /&gt;
	$idButton_1 = GUICtrlCreateButton(&amp;quot;Run Notepad&amp;quot;, 4, 4, 80, 30)&lt;br /&gt;
	$idButton_2 = GUICtrlCreateButton(&amp;quot;Button Test&amp;quot;, 4, 38, 80, 30)&lt;br /&gt;
&lt;br /&gt;
	GUISetState() ; will display a dialog box with 2 button&lt;br /&gt;
&lt;br /&gt;
	; Run the GUI until the dialog is closed&lt;br /&gt;
	While 1&lt;br /&gt;
		$iMsg = GUIGetMsg()&lt;br /&gt;
		Select&lt;br /&gt;
			Case $iMsg = $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			Case $iMsg = $idButton_1&lt;br /&gt;
				Run(&amp;quot;Notepad.exe&amp;quot;) ; Will Run/Open Notepad&lt;br /&gt;
			Case $iMsg = $idButton_2&lt;br /&gt;
				MsgBox($MB_SYSTEMMODAL, &amp;quot;Testing&amp;quot;, &amp;quot;Button 2 was pressed&amp;quot;) ; Will demonstrate Button 2 being pressed&lt;br /&gt;
		EndSelect&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multiple Examples ===&lt;br /&gt;
The helpfile now supports multiple examples per function. In order to maintain backwards compatibility with any other tools that use examples, the first file is still named &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;.au3&amp;lt;/code&amp;gt;, but any additional examples are named &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;[n].au3&amp;lt;/code&amp;gt; where n is an integer counter starting at 2.&lt;br /&gt;
&lt;br /&gt;
== Template UDF ==&lt;br /&gt;
Here is an example of a UDF called &amp;lt;code&amp;gt;MyUDF.au3&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include-once&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;MyUDFConstants.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;AnInclude.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: MyUDF&lt;br /&gt;
; AutoIt Version : 3.3.6.1&lt;br /&gt;
; Language ......: English&lt;br /&gt;
; Description ...: An example UDF that does very little.&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagMYSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagMYSTRUCT&lt;br /&gt;
; Description ...: An example of a structure.&lt;br /&gt;
; Fields ........: hFoo       - A handle to foo that does something.&lt;br /&gt;
;                  iBar       - An integer that does something.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: _MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagMYSTRUCT = &amp;quot;ptr hFoo; int iBar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _MyUDF_Function&lt;br /&gt;
; Description ...: A function that does something.&lt;br /&gt;
; Syntax.........: _MyUDF_Function(ByRef $avAnArray, $iAnInt[, $hAHandle = 0[, $nSomeNumber = 42]])&lt;br /&gt;
; Parameters ....: $avAnArray       - [byref] An array of anything. The value of anything is changed and passed out using this&lt;br /&gt;
;                                     parameter. The array should only have one dimension&lt;br /&gt;
;                  $iAnInt          - An integer that does very little.&lt;br /&gt;
;                  $hAHandle        - [optional] A handle. Default is zero.&lt;br /&gt;
;                  $nSomeNumber     - [optional] A number of some kind. Default is 42.&lt;br /&gt;
; Return values .: Success          - A MYSTRUCT structure.&lt;br /&gt;
;                  Failure          - Returns zero and sets the @error flag:&lt;br /&gt;
;                                   |1 - The $avAnArray is invalid.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: $tagMYSTRUCT&lt;br /&gt;
; Link ..........:&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _MyUDF_Function(ByRef $avAnArray, $iAnInt, $hAHandle = 0, $nSomeNumber = 42)&lt;br /&gt;
	; 1 - Error Checking for parameters.&lt;br /&gt;
	If Not IsArray($avAnArray) Or UBound($avAnArray, 0) &amp;lt;&amp;gt; 1 Then Return SetError(1, 0, 0) ; The $avAnArray is invalid.&lt;br /&gt;
&lt;br /&gt;
	; 2 - Declaration of locals.&lt;br /&gt;
	Local $tMS = DllStructCreate($tagMYSTRUCT)&lt;br /&gt;
&lt;br /&gt;
	; 3 - Function code&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;hFoo&amp;quot;, $hAHandle)&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;iBar&amp;quot;, $iAnInt * $nSomeNumber)&lt;br /&gt;
&lt;br /&gt;
	Return $tMS&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyUDF_Function&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=11509</id>
		<title>Talk:UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=11509"/>
		<updated>2013-01-07T01:38:32Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Coding Practice */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is currently under construction by Mat. It is being ported from this page: [http://dl.dropbox.com/u/22257420/Programming/UdfSpec.html]&lt;br /&gt;
&lt;br /&gt;
All content has been copied across, but links may not work and formatting may be broken.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mat|Mat]] 09:28, 16 November 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Outdated information ==&lt;br /&gt;
New updates to AutoIt are including changes to the syntax. Certain sections of this document will need to be revisited. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* There are a number of places where current headers differ slightly from these standards. &lt;br /&gt;
** Structures aren&#039;t using the Related field. It was added here as it is looked for by the docs generator, and should be there anyway.&lt;br /&gt;
** Structures have a varied naming convention, not always following the rule of including the type notation. Particularly StructureConstants.au3.&lt;br /&gt;
* The header for _WinAPI_GetMousePos isn&#039;t as it appears above, but it should be.&lt;br /&gt;
* Variable naming is still a matter of personal style. As long as it&#039;s readable and makes sense then it is acceptable. That part remains a guideline as opposed to a standard.&lt;br /&gt;
* There probably needs to be two versions of this document. One for MVPs working directly with the UDFs and examples and another for other community members working on non-standard UDFs.&lt;br /&gt;
&lt;br /&gt;
== Coding Practice ==&lt;br /&gt;
&lt;br /&gt;
This page does not currently cover coding practices other than naming conventions. The topic of programming best practice is very broad and so I have no intention of adding it to this page.&lt;br /&gt;
&lt;br /&gt;
Useful links:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/146866-best-coding-practices-in-autoit/ Best Coding Practices In AutoIt [Forums&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Mdiesel|Mdiesel]] ([[User talk:Mdiesel|talk]]) 01:38, 7 January 2013 (UTC)&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User:Mdiesel&amp;diff=10850</id>
		<title>User:Mdiesel</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User:Mdiesel&amp;diff=10850"/>
		<updated>2012-11-05T22:41:58Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: Update contact info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt Forum profile: http://www.autoitscript.com/forum/index.php?showuser=46719&lt;br /&gt;
&lt;br /&gt;
Website: http://ma.ttdiesel.co.uk/&lt;br /&gt;
&lt;br /&gt;
AutoIt scripts page: http://code.google.com/p/m-a-t/&lt;br /&gt;
&lt;br /&gt;
AutoIt projects list: http://code.google.com/p/m-a-t/wiki/WhatIveDone&lt;br /&gt;
&lt;br /&gt;
email: M@ttDiesel.co.uk&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=10825</id>
		<title>UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=UDF-spec&amp;diff=10825"/>
		<updated>2012-09-24T18:33:22Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Undocumented Listing */ corrected typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is still under construction.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A library is a collection of one or more User Defined Functions (UDFs). However, the term UDF is often used to describe the collection as a whole. If a UDF is to be considered for inclusion in the standard set distributed with AutoIt then it must meet all the criteria detailed here, but it&#039;s also good practice to always write in conformance with at least the majority of this document, as that is what will be expected by people reading your code later.&lt;br /&gt;
&lt;br /&gt;
== Basic Requirements ==&lt;br /&gt;
Firstly, the code itself should meet the following basic requirements:&lt;br /&gt;
&lt;br /&gt;
* Be tidied. Just hit &amp;lt;code&amp;gt;Ctrl+T&amp;lt;/code&amp;gt; from SciTE or run Tidy manually. The only flag needed is &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Pass Au3Check with no errors using the strictest settings: &amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;&lt;br /&gt;
* Support everything AutoIt supports. In some cases features may not be able to support everything, in which case this should be checked for and return errors appropriately. This applies to: windows OS versions (AutoIt has support for all OS&#039; from windows 2000), unicode and ansi strings, 64 and 32 bit machines.&lt;br /&gt;
* Ideally it will be able to run cleanly when obfuscated. Although there will be some cases where this is not possible, please consider it when writing UDFs, and avoid the use of Execute and similar statements. If it does not, then document it as such.&lt;br /&gt;
&lt;br /&gt;
== UDF Outline ==&lt;br /&gt;
The library itself has a header that details important information such as the minimum OS and AutoIt versions, and what system dlls are required. There is also a number of other sections that are required that list what is present in the UDF.&lt;br /&gt;
&lt;br /&gt;
=== Includes ===&lt;br /&gt;
Since a UDF is designed to define functions, it should only be included once. As a result, the &amp;lt;code&amp;gt;#include-once&amp;lt;/code&amp;gt; directive should be used. This is typically the first line of the UDF, followed by the includes used by the UDF. Include statements should use the double quoted form, as the library is expected to work in the same directory as libraries it depends on. Non standard libraries can be used if necessary, but this should be documented and linked to so users can download it as well. It goes without saying that a UDF based on non-standard UDFs cannot itself become a standard.&lt;br /&gt;
&lt;br /&gt;
=== Index ===&lt;br /&gt;
The index follows the following template (taken from &amp;lt;code&amp;gt;WinAPI.au3&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: Windows API&lt;br /&gt;
; AutoIt Version : 3.2&lt;br /&gt;
; Description ...: Windows API calls that have been translated to AutoIt functions.&lt;br /&gt;
; Author(s) .....: Paul Campbell (PaulIA), gafrost, Siao, Zedna, arcker, Prog@ndy, PsaltyDS, Raik, jpm&lt;br /&gt;
; Dll ...........: kernel32.dll, user32.dll, gdi32.dll, comdlg32.dll, shell32.dll, ole32.dll, winspool.drv&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only required element in the index header is &amp;lt;code&amp;gt;Title&amp;lt;/code&amp;gt;. All others are ignored by the processor, but should be included for reference&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Dll&amp;lt;/code&amp;gt; field can remain empty in many cases where no dlls are called directly. This header must be defined.&lt;br /&gt;
&lt;br /&gt;
=== Other Sections ===&lt;br /&gt;
Other sections, in order of appearance, are as follows.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
All global variables needed to be declared in the UDF are defined in this section. They should follow the variable rules for globals. Individual variables do not need to be documented, as it is assumed they are for internal use only. Any globals designed to be accessible for the user should instead be wrapped by a function (or multiple functions if globals must be retrieved and set). The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #VARIABLES# ===================================================================================================================&lt;br /&gt;
Global $__gvMyGlobal = 0&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no globals are needed then this section may be ommitted. Please consider the use of global variables carefully, and read through the section on global variables.&lt;br /&gt;
&lt;br /&gt;
==== Constants ====&lt;br /&gt;
Any global constant values are defined in this section. This should be constants only designated for use within the library itself. Constants that may be needed by the user should be defined in a seperate file, named &amp;lt;code&amp;gt;UDFConstants.au3&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;UDF&amp;lt;/code&amp;gt; is the name of the parent file. For example &amp;lt;code&amp;gt;File.au3&amp;lt;/code&amp;gt; uses constants defined in &amp;lt;code&amp;gt;FileConstants.au3&amp;lt;/code&amp;gt;. The exception to that rule is control UDFs which miss out the prepended &#039;GUI&#039; when naming constant files, so &amp;lt;code&amp;gt;GUIButton.au3&amp;lt;/code&amp;gt; uses constants from &amp;lt;code&amp;gt;ButtonConstants.au3&amp;lt;/code&amp;gt;. The template for this section is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CONSTANTS# ===================================================================================================================&lt;br /&gt;
Global Const $__MYUDFCONSTANT_FOOBAR = 42&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no constants are needed in this section, either because non are used or because they are stored in a seperate file, then it may be ommitted. Please read the section on global constants for specific info on naming and definition of constants.&lt;br /&gt;
&lt;br /&gt;
==== Listing ====&lt;br /&gt;
This defines all functions and structures currently used functions in the library. It MUST be the second defined header item after [[#Index]]. It is a simple list with each function on a line where the functions and structures appear in the same order as they do in the code, which is alphabetical order and structures first. A simple way to generate this list is to create a small script that searches for function definitions and outputs them in the correct format, an example of which is [http://www.autoitscript.com/forum/topic/120820-function-name-lister/ here]. In addition there is a second section that lists functions and structures for internal use only, this does not need to appear if none are defined.&lt;br /&gt;
&lt;br /&gt;
The template for these sections are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
;$tagINTERNALSTRUCT&lt;br /&gt;
;__MyUDF_InternalFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section still needs to be defined for files that only define constants. It should also be noted that there MUST NOT be a space between the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; and the function/structure name.&lt;br /&gt;
&lt;br /&gt;
==== Undocumented Listing ====&lt;br /&gt;
There is a final kind of listing that lists functions for which no documentation exists, or they have been deprecated and are only included for backwards compatibility. These are listed in a section with the header &amp;lt;code&amp;gt;NO_DOC_FUNCTION&amp;lt;/code&amp;gt;. This is very rarely used, and is reserved only for functions that can be utilised by the user, or that would have been in the past, as opposed to those for internal use only.&lt;br /&gt;
&lt;br /&gt;
Template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Renamed Functions ====&lt;br /&gt;
Although it should not be the case in new UDFs, many of the older ones (particularly to do with controls) have had script breaking name changes to functions. These are documented in the UDF to ensure updating old scripts is as easy as possible. The basic format for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #NO_DOC_FUNCTION# =============================================================================================================&lt;br /&gt;
;_MyUDF_OldFunction                        ; --&amp;gt; _MyUDF_NewFunction&lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The space padding is optional. This section is ignored as far as the docs are concerned, and is usually omitted.&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
=== Naming ===&lt;br /&gt;
Function names must start with an underscore, and the first word is the library name. There is then usually another underscore before the rest of the function name. The library name should be consistent across all the functions in the library, and can be shortened if a logical abbreviation is available (e.g. &amp;lt;code&amp;gt;Window&amp;lt;/code&amp;gt; ==&amp;gt; &amp;lt;code&amp;gt;Win&amp;lt;/code&amp;gt;). Each word should be capitalized, but no underscores are placed in the rest of the name, for example &amp;lt;code&amp;gt;_WinAPI_GetWindowLong&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For control libraries, the first part of the function name is changed slightly. For example the UDF for listviews would use &amp;lt;code&amp;gt;_GUICtrlListview_*&amp;lt;/code&amp;gt;. When a function wraps a dll call, then the second part should closely resemble the function name as it appears in other languages. This also applies to functions acting as a wrapper to &amp;lt;code&amp;gt;SendMessage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Functions are defined in alphabetical order by name, which is the same as using &amp;lt;code&amp;gt;Tidy&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;/sf&amp;lt;/code&amp;gt; flag set.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
Parameters should follow the variable naming scheme ([[#Naming_2|here]]). All parameters must be checked to ensure they are valid, and return unique and documented error codes if they are not. For functions involving a specific type of control, this includes checking the class name using &amp;lt;code&amp;gt;_WinAPI_IsClassName&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Parameters that are optional or byref should be documented as such, and the effect these have explicitly stated. For example a byref parameter should detail exactly what the expected output is as well as the input.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
All functions have a documentation header that describes the function. This uses the following template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _WinAPI_GetMousePos&lt;br /&gt;
; Description ...: Returns the current mouse position&lt;br /&gt;
; Syntax.........: _WinAPI_GetMousePos([$fToClient = False[, $hWnd = 0]])&lt;br /&gt;
; Parameters ....: $fToClient   - If True, the coordinates will be converted to client coordinates&lt;br /&gt;
;                  $hWnd        - Window handle used to convert coordinates if $fToClient is True&lt;br /&gt;
; Return values .: Success      - $tagPOINT structure with current mouse position&lt;br /&gt;
;                  Failure      - Zero&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......: This function takes into account the current MouseCoordMode setting when  obtaining  the  mouse  position.  It&lt;br /&gt;
;                  will also convert screen to client coordinates based on the parameters passed.&lt;br /&gt;
; Related .......: $tagPOINT, _WinAPI_GetMousePosX, _WinAPI_GetMousePosY&lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _WinAPI_GetMousePos($fToClient = False, $hWnd = 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The header is 129 characters wide, and any text within it should be wrapped to that length. For example the &amp;lt;code&amp;gt;Remarks&amp;lt;/code&amp;gt; in the above header has been extended to cover two lines. The exception to that rule is the &amp;lt;code&amp;gt;Syntax&amp;lt;/code&amp;gt; line, which should not be wrapped. Some of the parameters in the header are optional, in which case they should remain, but be left empty (for example the &amp;lt;code&amp;gt;Link&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Modified&amp;lt;/code&amp;gt; lines in the above header). In others, they are needed, but can be empty or not used such as &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return Values&amp;lt;/code&amp;gt;. In this case the value should be &#039;None&#039;, as they will still be present in the documentation.&lt;br /&gt;
&lt;br /&gt;
There are some flags that can be used within function headers: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 20 is the continuation flag for the previous line (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; in column 20 is a new line in the right side of the table when the help file is generated (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;-&#039;&#039;&#039; in column 20 will create new row in the table, used for things like Defaults for a style (used in Parameters, Return Values)&lt;br /&gt;
* &#039;&#039;&#039;+&#039;&#039;&#039; in column 2 of Remarks is a blank line&lt;br /&gt;
Name&lt;br /&gt;
:Specifies the name of the function. This will be identical to how it appeas in the Func statement in the code itself.&lt;br /&gt;
Description&lt;br /&gt;
:Gives a short summary of what the function does. This should only be a single line, as it is only designed to give a short impression of what is happening. For the standard set of includes distributed with AutoIt3, this value is also used in the SciTE calltips.&lt;br /&gt;
Syntax&lt;br /&gt;
:Describes the syntax of the function call. This differs slightly from what appears in the code itself for optional parameters, which are enclosed in square brackets (&amp;quot;[ ]&amp;quot;). Since subsequent parameters must also be optional, and cannot be defined unless all the previous ones have been given, these brackets are nested in the form: Function([param1[, param2[,param3]]]). Note that the opening bracket appears before the comma seperator.&lt;br /&gt;
Parameters&lt;br /&gt;
:This is a list of the arguments accepted by the function. Each is listed, followed by a dash (&amp;quot;-&amp;quot;) and a description of what it is. The dash can be padded for neatness, although the amount of padding depends on how long the parameter names are. If the parameter is optional then the meaning of the default value should be given, similarly if it&#039;s used to pass data back to the program in the form of byref then the changes made should also be detailed. For more information on parameters see Parameters.&lt;br /&gt;
Return values&lt;br /&gt;
:Details what is returned by the function. This often comes in the form of Success and Failure values, but this is not always the case. Any setting of the @error of @extended flags should be detailed, along with their meanings, in some cases it is enough to say that @error is set to non-zero in the event of an error, in most cases though a list of values for @error should be given.&lt;br /&gt;
Author&lt;br /&gt;
:This is the original writer of the function. It should contain the username, so that any queries about the code can be made through the forum, but you can give as much or little information as you feel appropriate.&lt;br /&gt;
Modified&lt;br /&gt;
:This is a list of modifications made. At it&#039;s most basic this is just a list of users who have made changes, but ideally it includes some information about what they did, in which cases it follows the same form as other multi-value lines, with the username and description of modifications seperated by a dash.&lt;br /&gt;
Remarks&lt;br /&gt;
:This is anything the user should know about a function in order to use it. For example exceptional cases and recommended ways to handle the function should all be detailed here, as well as additional info about possible reasons for failure and how to deal with them.&lt;br /&gt;
Related&lt;br /&gt;
:A comma seperated list of functions or structures related to the function.&lt;br /&gt;
Link&lt;br /&gt;
:A link to additional information about the function. For many system function wrappers, this will be &amp;lt;code&amp;gt;@@MsdnLink@@ FunctionName&amp;lt;/code&amp;gt;, which represents that the user should search MSDN for the function.&lt;br /&gt;
Example&lt;br /&gt;
:A simple yes or no value specifying whether the function has an example. If this is no then your UDF is not ready to be released. The [[#Examples]] section has more information on the format and location of examples.&lt;br /&gt;
&lt;br /&gt;
The easiest way to generate the header is to copy and paste the following blank template in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also a number of plugins for SciTE that will generate a header and maybe fill in certain known values for you such as Name, Syntax and Parameters. The most complete one that conforms to these standards is [http://code.google.com/p/m-a-t/wiki/UDFHeaderGenerator here], but there are two others [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/ here] and [http://www.autoitscript.com/forum/topic/28270-lua-script-for-udf-header/page__view__findpost__p__200823 here].&lt;br /&gt;
&lt;br /&gt;
=== Internal use only ===&lt;br /&gt;
Functions can also be marked for use only within the library and not to be documented for use by the user. These are named according to the same rules as normal functions but begin with a double underscore (&amp;quot;__&amp;quot;). The header is exactly the same except with the first line replaced, to make the blank template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Syntax.........: &lt;br /&gt;
; Parameters ....: &lt;br /&gt;
; Return values .: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Modified.......: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; Link ..........: &lt;br /&gt;
; Example .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structures ==&lt;br /&gt;
Structures are defined as global constants, and follow the naming pattern &amp;lt;code&amp;gt;$tagSTRUCTNAME&amp;lt;/code&amp;gt;. The struct name should be as it appears on MSDN if it&#039;s used in the windows API, or follow a similar pattern if not. It should go without saying that they must work for both 32 and 64 bit machines, including resolving any alignment issues. Elements should also be named as they appear on MSDN if they are taken from there, which includes the hungarian notation prefix. Although many standard UDFs do not follow that rule, importantly &amp;lt;code&amp;gt;StructureConstants.au3&amp;lt;/code&amp;gt;, the rule still stands.&lt;br /&gt;
&lt;br /&gt;
=== Headers ===&lt;br /&gt;
Structures need a header similar to functions, but with some minor differences. The same rules apply in terms of wrapping and line length however. The header follow this standard template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagPOINT&lt;br /&gt;
; Description ...: Defines the x and y coordinates of a point&lt;br /&gt;
; Fields ........: X - Specifies the x-coordinate of the point&lt;br /&gt;
;                  Y - Specifies the y-coordinate of the point&lt;br /&gt;
; Author ........: Paul Campbell (PaulIA)&lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagPOINT = &amp;quot;long X;long Y&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is essentially a shortened header, with the only thing new is the Fields line, which effectively replaces the Parameters field in terms of usage. All the same rules apply as listed [[#Function Header Fields|here]].&lt;br /&gt;
&lt;br /&gt;
The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Structures may also be marked for internal use only. In this case the header ramains the same, but the sections first line changes. The blank template is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;; #INTERNAL_USE_ONLY# ===========================================================================================================&lt;br /&gt;
; Name...........: &lt;br /&gt;
; Description ...: &lt;br /&gt;
; Fields ........: &lt;br /&gt;
; Author ........: &lt;br /&gt;
; Remarks .......: &lt;br /&gt;
; Related .......: &lt;br /&gt;
; ===============================================================================================================================&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
For code readability, there are special rules dealing with variables, particularly naming. All variables should be declared at the beginning of their scope, which usually means at the start of the function in which they are used, but could mean the top of the UDF itself in the [[#Variables|Variables section]].&lt;br /&gt;
&lt;br /&gt;
=== Naming ===&lt;br /&gt;
A variables first letter signifies the expected type of the variable. This should be as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$a&amp;amp;lt;letter&amp;amp;gt;&amp;lt;/code&amp;gt; - Array (the following letter describes the data type taken from the rest of the data types below, if it varies then &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; should be used. A counter as the first element is ignored, so the array returned by StringSplit (with default options) would actually be marked as $as despite the integer in the zeroeth element).&lt;br /&gt;
* &amp;lt;code&amp;gt;$d&amp;lt;/code&amp;gt; - Binary data.&lt;br /&gt;
* &amp;lt;code&amp;gt;$h&amp;lt;/code&amp;gt; - Handle, usually to a file or window. NB: AutoIt handled controls return IDs, and so use $id instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt; - An AutoIt control Id.&lt;br /&gt;
* &amp;lt;code&amp;gt;$i&amp;lt;/code&amp;gt; - Integer.&lt;br /&gt;
* &amp;lt;code&amp;gt;$b&amp;lt;/code&amp;gt; - Boolean.&lt;br /&gt;
* &amp;lt;code&amp;gt;$f&amp;lt;/code&amp;gt; - Floating point number.&lt;br /&gt;
* &amp;lt;code&amp;gt;$n&amp;lt;/code&amp;gt; - general number with no preference for floating point or integral.&lt;br /&gt;
* &amp;lt;code&amp;gt;$s&amp;lt;/code&amp;gt; - String.&lt;br /&gt;
* &amp;lt;code&amp;gt;$v&amp;lt;/code&amp;gt; - Variant (unknown/variable type of data) .&lt;br /&gt;
* &amp;lt;code&amp;gt;$p&amp;lt;/code&amp;gt; - Pointer. It is assumed that it points to a struct so no further letters are needed. The type of struct being pointed to should be inferrable from the variable name e.g. &amp;lt;code&amp;gt;$pWindowRect&amp;lt;/code&amp;gt; can be assumed to be a pointer to a &amp;lt;code&amp;gt;$tagRECT&amp;lt;/code&amp;gt; structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;$t&amp;lt;/code&amp;gt; - Structure returned from DllStructCreate.&lt;br /&gt;
* &amp;lt;code&amp;gt;$tag&amp;lt;/code&amp;gt; - Struct definition string.Structure definitions should conform to the structure guidelines.&lt;br /&gt;
&lt;br /&gt;
=== Globals ===&lt;br /&gt;
The use of globals in a UDF is generally frowned upon, and byref parameters and static variables should be used where possible instead. However, in cases where this is not possible and a global must be used they should be defined using the following naming pattern: &amp;lt;code&amp;gt;$__g&amp;amp;lt;VARNAME&amp;amp;gt;_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;&amp;amp;lt;VARNAME&amp;amp;gt;&amp;lt;/code&amp;gt; is the name as it would usually appear according to the variable naming rules above and &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; is the name of the library in which it appears. This ensures there will never be a conflict with user variables of other UDF globals. They should be declared at the top of the UDF in the Variables section.&lt;br /&gt;
&lt;br /&gt;
Globals are always private. If they need to be accessed by the user then functions need to be written wrapping that operation and values should be checked. Notable exceptions are debug variables, which are designed for developer purposes and may be used by some users in extreme cases. These are named &amp;lt;code&amp;gt;$Debug_&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; although the &amp;lt;code&amp;gt;&amp;amp;lt;UDF&amp;amp;gt;&amp;lt;/code&amp;gt; part is often shortened so &amp;lt;code&amp;gt;GUIEdit.au3&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;$Debug_Ed&amp;lt;/code&amp;gt;. It is not required that a UDF has debugging symbols, but they are allowed to remain in releases.&lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
There are two types of constants, internal and public. Public constants are designed to be utilised by the user, and are referenced in functions that use them. They include styles and flags. Internal constants are designed for use only within the library, so that values used fairly often can be held in one place to allow for easy updating. Both kinds of constant are always typed in all upper case. Constants taken from the windows API should appear exactly as they are defined there, but internal constants follow the naming pattern: &amp;lt;code&amp;gt;$__&amp;amp;lt;UDF&amp;amp;gt;CONSTANT_&amp;amp;lt;NAME&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;lt;code&amp;gt;Dim&amp;lt;/code&amp;gt; statement ===&lt;br /&gt;
Should not be used.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
All functions and structures that are made public to the user need to have a good quality example. This means that it should:&lt;br /&gt;
&lt;br /&gt;
* Be simple. Ideally the only functions used are basic functions like ConsoleWrite and MsgBox and the function that the example is written for. Writing a single example that covers a wide range of functions is not nearly as easy to use as writing an example per function that clearly demonstrates its use.&lt;br /&gt;
* Be readable. Everything should be explained step by step in comments.&lt;br /&gt;
* Be correct. In addition to passing the same Au3Check flags as the UDF itself (&amp;lt;code&amp;gt;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7&amp;lt;/code&amp;gt;) it should always be written with best practice being the main consideration. This takes preference over the first point, just because code is shorter and looks easier doesn&#039;t mean it&#039;s right.&lt;br /&gt;
* Examples should represent all the functionality. If there are more than one ways of using a function then include more than one example of how to use it.&lt;br /&gt;
&lt;br /&gt;
Examples are stored in individual files called &amp;lt;code&amp;gt;&amp;amp;lt;FUNCTION&amp;amp;gt;.au3&amp;lt;/code&amp;gt;. The files should be kept in a folder called &amp;lt;code&amp;gt;Examples&amp;lt;/code&amp;gt;. To remain correct all examples should be wrapped in functions, such that the only code executed in the global scope is calling the function. This is usually named &amp;lt;code&amp;gt;Example&amp;lt;/code&amp;gt;, though where multiple examples exists they are named &amp;lt;code&amp;gt;Example1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Example2&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;ExampleN&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $idButton_1, $idButton_2, $iMsg, $hGUI&lt;br /&gt;
	&lt;br /&gt;
	$hGUI = GUICreate(&amp;quot;My GUI Button&amp;quot;) ; Will create a dialog box that when displayed is centered&lt;br /&gt;
&lt;br /&gt;
	$idButton_1 = GUICtrlCreateButton(&amp;quot;Run Notepad&amp;quot;, 4, 4, 80, 30)&lt;br /&gt;
	$idButton_2 = GUICtrlCreateButton(&amp;quot;Button Test&amp;quot;, 4, 38, 80, 30)&lt;br /&gt;
&lt;br /&gt;
	GUISetState() ; will display a dialog box with 2 button&lt;br /&gt;
&lt;br /&gt;
	; Run the GUI until the dialog is closed&lt;br /&gt;
	While 1&lt;br /&gt;
		$iMsg = GUIGetMsg()&lt;br /&gt;
		Select&lt;br /&gt;
			Case $iMsg = $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			Case $iMsg = $idButton_1&lt;br /&gt;
				Run(&amp;quot;Notepad.exe&amp;quot;) ; Will Run/Open Notepad&lt;br /&gt;
			Case $iMsg = $idButton_2&lt;br /&gt;
				MsgBox(0, &amp;quot;Testing&amp;quot;, &amp;quot;Button 2 was pressed&amp;quot;) ; Will demonstrate Button 2 being pressed&lt;br /&gt;
		EndSelect&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Template UDF ==&lt;br /&gt;
Here is an example of a UDF called &amp;lt;code&amp;gt;MyUDF.au3&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include-once&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;MyUDFConstants.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;AnInclude.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #INDEX# =======================================================================================================================&lt;br /&gt;
; Title .........: MyUDF&lt;br /&gt;
; AutoIt Version : 3.3.6.1&lt;br /&gt;
; Language ......: English&lt;br /&gt;
; Description ...: An example UDF that does very little.&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #CURRENT# =====================================================================================================================&lt;br /&gt;
;$tagMYSTRUCT&lt;br /&gt;
;_MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
; #STRUCTURE# ===================================================================================================================&lt;br /&gt;
; Name...........: $tagMYSTRUCT&lt;br /&gt;
; Description ...: An example of a structure.&lt;br /&gt;
; Fields ........: hFoo       - A handle to foo that does something.&lt;br /&gt;
;                  iBar       - An integer that does something.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: _MyUDF_Function&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Global Const $tagMYSTRUCT = &amp;quot;ptr hFoo; int iBar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name...........: _MyUDF_Function&lt;br /&gt;
; Description ...: A function that does something.&lt;br /&gt;
; Syntax.........: _MyUDF_Function(ByRef $avAnArray, $iAnInt[, $hAHandle = 0[, $nSomeNumber = 42]])&lt;br /&gt;
; Parameters ....: $avAnArray       - [byref] An array of anything. The value of anything is changed and passed out using this&lt;br /&gt;
;                                     parameter. The array should only have one dimension&lt;br /&gt;
;                  $iAnInt          - An integer that does very little.&lt;br /&gt;
;                  $hAHandle        - [optional] A handle. Default is zero.&lt;br /&gt;
;                  $nSomeNumber     - [optional] A number of some kind. Default is 42.&lt;br /&gt;
; Return values .: Success          - A MYSTRUCT structure.&lt;br /&gt;
;                  Failure          - Returns zero and sets the @error flag:&lt;br /&gt;
;                                   |1 - The $avAnArray is invalid.&lt;br /&gt;
; Author ........: Matt Diesel (Mat)&lt;br /&gt;
; Modified.......:&lt;br /&gt;
; Remarks .......:&lt;br /&gt;
; Related .......: $tagMYSTRUCT&lt;br /&gt;
; Link ..........:&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _MyUDF_Function(ByRef $avAnArray, $iAnInt, $hAHandle = 0, $nSomeNumber = 42)&lt;br /&gt;
	; 1 - Error Checking for parameters.&lt;br /&gt;
	If Not IsArray($avAnArray) Or UBound($avAnArray, 0) &amp;lt;&amp;gt; 1 Then Return SetError(1, 0, 0) ; The $avAnArray is invalid.&lt;br /&gt;
&lt;br /&gt;
	; 2 - Declaration of locals.&lt;br /&gt;
	Local $tMS = DllStructCreate($tagMYSTRUCT)&lt;br /&gt;
&lt;br /&gt;
	; 3 - Function code&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;hFoo&amp;quot;, $hAHandle)&lt;br /&gt;
	DllStructSetData($tMS, &amp;quot;iBar&amp;quot;, $iAnInt * $nSomeNumber)&lt;br /&gt;
&lt;br /&gt;
	Return $tMS&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyUDF_Function&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=10824</id>
		<title>Talk:UDF-spec</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:UDF-spec&amp;diff=10824"/>
		<updated>2012-09-24T18:30:41Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is currently under construction by Mat. It is being ported from this page: [http://dl.dropbox.com/u/22257420/Programming/UdfSpec.html]&lt;br /&gt;
&lt;br /&gt;
All content has been copied across, but links may not work and formatting may be broken.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mat|Mat]] 09:28, 16 November 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Outdated information ==&lt;br /&gt;
New updates to AutoIt are including changes to the syntax. Certain sections of this document will need to be revisited. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* There are a number of places where current headers differ slightly from these standards. &lt;br /&gt;
** Structures aren&#039;t using the Related field. It was added here as it is looked for by the docs generator, and should be there anyway.&lt;br /&gt;
** Structures have a varied naming convention, not always following the rule of including the type notation. Particularly StructureConstants.au3.&lt;br /&gt;
* The header for _WinAPI_GetMousePos isn&#039;t as it appears above, but it should be.&lt;br /&gt;
* Variable naming is still a matter of personal style. As long as it&#039;s readable and makes sense then it is acceptable. That part remains a guideline as opposed to a standard.&lt;br /&gt;
* There probably needs to be two versions of this document. One for MVPs working directly with the UDFs and examples and another for other community members working on non-standard UDFs.&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Talk:User_Defined_Functions&amp;diff=10823</id>
		<title>Talk:User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Talk:User_Defined_Functions&amp;diff=10823"/>
		<updated>2012-09-24T18:28:12Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: Explained link removal and changes to wrappers thread&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should really be a spin-off from: http://www.autoitscript.com/forum/index.php?showtopic=19370&lt;br /&gt;
[[User:Manadar|Manadar]] 13:12, 27 May 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Migrated UDF List here ==&lt;br /&gt;
&lt;br /&gt;
The old page can still be seen here: http://www.autoitscript.com/w/index.php?title=UDF_List&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
== Changes to AutoIt wrappers ==&lt;br /&gt;
&lt;br /&gt;
Currently the old wrappers forum thread by valuator is locked and is being migrated to the wiki (link?). I have just removed the outdated link for now.&lt;br /&gt;
--[[User:Mat|Mat]] 19:28, 24 September 2012 (BST)&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User:Mdiesel&amp;diff=9569</id>
		<title>User:Mdiesel</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User:Mdiesel&amp;diff=9569"/>
		<updated>2011-11-16T15:21:33Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt Forum profile: http://www.autoitscript.com/forum/index.php?showuser=46719&lt;br /&gt;
&lt;br /&gt;
Website: http://matdiesel.co.uk/&lt;br /&gt;
&lt;br /&gt;
AutoIt scripts page: http://code.google.com/p/m-a-t/&lt;br /&gt;
&lt;br /&gt;
AutoIt projects list: http://code.google.com/p/m-a-t/wiki/WhatIveDone&lt;br /&gt;
&lt;br /&gt;
email: Mat@Weirdness.com&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=File:Autoit-1-2-3.jpg&amp;diff=8174</id>
		<title>File:Autoit-1-2-3.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=File:Autoit-1-2-3.jpg&amp;diff=8174"/>
		<updated>2009-05-27T13:41:39Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: The AutoIt-1-2-3 getting started screen. Here it gives you links to important links, and also allows you to run the demo&amp;#039;s that come with the program.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The AutoIt-1-2-3 getting started screen. Here it gives you links to important links, and also allows you to run the demo&#039;s that come with the program.&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=AutoIt_Environment&amp;diff=8172</id>
		<title>AutoIt Environment</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=AutoIt_Environment&amp;diff=8172"/>
		<updated>2009-05-27T13:33:49Z</updated>

		<summary type="html">&lt;p&gt;Mdiesel: /* Choosing a Text Editor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
The installation directory for AutoIt (usually located in &#039;&#039;\Program Files\AutoIt3\&#039;&#039;) looks like this:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ &amp;lt;b&amp;gt;&amp;amp;laquo;AutoIt v3 Install Directory Structure &amp;amp;mdash; &amp;lt;i&amp;gt;As of v3.1.1.0&amp;lt;/i&amp;gt;&amp;amp;raquo;&amp;lt;/b&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; style=&amp;quot;background:#666666; color:#FFFFFF&amp;quot; | Files / Directories&lt;br /&gt;
! align=&amp;quot;center&amp;quot; style=&amp;quot;background:#666666; color:#FFFFFF&amp;quot; | Description&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| AutoIt3.exe&lt;br /&gt;
| The AutoIt v3 Main Program (typically, the only file required to run scripts)&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| AU3Info.exe&lt;br /&gt;
| The AutoIt Active Window Info tool (was AU3_Spy.exe)&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| AutoIt.chm&lt;br /&gt;
| The AutoIt v3 Help file&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| PSAPI.DLL&lt;br /&gt;
| &amp;lt;tt&amp;gt;Process...()&amp;lt;/tt&amp;gt; function Helper DLL (required for Windows&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt; NT 4; Microsoft&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt; redistributable file)&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | Aut2Exe&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | AutoIt Script Compiler Components&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Aut2Exe&amp;amp;nbsp;\ Aut2Exe.exe&lt;br /&gt;
| The Script Compiler&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Aut2Exe&amp;amp;nbsp;\ AutoItSC.bin&lt;br /&gt;
| Executable Stub included into compiled scripts&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Aut2Exe&amp;amp;nbsp;\ upx.exe&lt;br /&gt;
| The UPX Compressor (for compressing compiled scripts)&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Aut2Exe&amp;amp;nbsp;\ Icons&amp;amp;nbsp;\&lt;br /&gt;
| Icons for use in compiled scripts&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | AutoItX&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | AutoIt Extension Samples&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| AutoItX&amp;amp;nbsp;\ ActiveX&amp;amp;nbsp;\&lt;br /&gt;
| Include AutoIt in Windows&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt; Script as an ActiveX&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt; Component&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| AutoItX&amp;amp;nbsp;\ StandardDLL&amp;amp;nbsp;\&lt;br /&gt;
| Include AutoIt in any program as a Dynamic Link Library&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | Examples&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | Example AutoIt scripts&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Examples&amp;amp;nbsp;\ GUI&amp;amp;nbsp;\&lt;br /&gt;
| Example GUI scripts&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Examples&amp;amp;nbsp;\ Helpfile&amp;amp;nbsp;\&lt;br /&gt;
| Example scripts from the Help file&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | Extras&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | Third-party / Contributed files provided for convenience&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Extras&amp;amp;nbsp;\ AutoUpdateIt&amp;amp;nbsp;\&lt;br /&gt;
| Check for and install updates to AutoIt&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Extras&amp;amp;nbsp;\ Editors&amp;amp;nbsp;\&lt;br /&gt;
| Syntax highlighting files for popular code editors (with auto-install scripts)&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Extras&amp;amp;nbsp;\ Exe2Aut&amp;amp;nbsp;\&lt;br /&gt;
| Compiled script decompilers (convert .exe back to .au3, if compiled with &#039;&#039;Allow_Decompile&#039;&#039;)&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
| Extras&amp;amp;nbsp;\ v2_to_v3_Converter&amp;amp;nbsp;\&lt;br /&gt;
| An AutoIt v2.64 to v3 script converter&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | Icons&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | Icons used for .au3 filetype icon in Explorer&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||&lt;br /&gt;
|- valign=&amp;quot;middle&amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#EEEEEE;&amp;quot; | Include&amp;amp;nbsp;\&lt;br /&gt;
| style=&amp;quot;background:#EEEEEE;&amp;quot; | Standard include files (pre-written user functions; see Library Functions in Help file)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It should be stressed that to run AutoIt scripts, the only required file is &#039;&#039;&#039;AutoIt3.exe&#039;&#039;&#039;. If you compile a script into an executable then a user does not require AutoIt to be installed to run that compiled executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Exception:&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt; Under Windows&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt; NT 4, the file &#039;&#039;&#039;PSAPI.DLL&#039;&#039;&#039; needs to be in the path or the AutoIt directory for the &amp;lt;tt&amp;gt;Process...()&amp;lt;/tt&amp;gt; related functions to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;lt;i&amp;gt;&lt;br /&gt;
:&amp;amp;bull;&amp;amp;nbsp;&amp;amp;nbsp;Updated to reflect the directory structure of AutoIt v3.1.1.0.&amp;lt;br&amp;gt;&lt;br /&gt;
:&amp;amp;bull;&amp;amp;nbsp;&amp;amp;nbsp;Duplicate listing of the &#039;&#039;&#039;Aut2Exe&#039;&#039;&#039; directory was removed.&amp;amp;nbsp; I assume this was supposed to be &#039;&#039;&#039;AutoItX&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/i&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Choosing a Text Editor ==&lt;br /&gt;
&lt;br /&gt;
Since Autoit scripts are simple text files, you can use any text editor to author your scripts. Even the humble &#039;&#039;&#039;Notepad&#039;&#039;&#039; that comes with Windows!&lt;br /&gt;
&lt;br /&gt;
However, there are substantial benefits to be had from more sophisticated text editors, including:&lt;br /&gt;
* Multi-document Interface (MDI) - which allows for editing several soure files simultaneously (useful when you start using AU3&#039;s #[[Compiler directives|include]], or want to copy between files.&lt;br /&gt;
* Project files - allowing you to identify a single shortcut when launching your text editor, which will instruct it to open a specific set of source files.&lt;br /&gt;
* Enhanced Search &amp;amp; Replace functionality.&lt;br /&gt;
* Source-code highlighting - based on the AU3 syntax.&lt;br /&gt;
* &amp;quot;Folding&amp;quot; - where portions of the file can be hidden from view to allow for easier editing.&lt;br /&gt;
* ClipBooks - some editors have a feature where you can store frequently used code snippets and copy them in at a click while coding.&lt;br /&gt;
* CHM interface - allowing quick and easy reference to the help file that comes with Autoit.&lt;br /&gt;
* Customisable tools - useful when you want to run a script &#039;&#039;from within&#039;&#039; the text editor. &lt;br /&gt;
&lt;br /&gt;
These features and more are available in text editors that are free or shareware. There are regular debates on the forums about which editor is the best, but in the end it all boils down to a personal choice. The following editors are very popular amongst AutoIt users:&lt;br /&gt;
&lt;br /&gt;
===Text Pad===&lt;br /&gt;
Text Pad is a shareware text editor from Helios Software Solutions.  It is available for download at http://www.textpad.com.  It is an excellent general purpose editor, and AutoIt comes with syntax files for Text Pad.  You can also run scripts you are editing directly from inside TextPad.  It is particularily good at editing many files at once, and is able to perform find and replace operations on many files at the same time.&lt;br /&gt;
&lt;br /&gt;
Text Pad costs &amp;amp;pound;16.50 British pounds, which is about &amp;amp;euro;24.80 Euros or $30.10 USD.  The evaluation version does not expire - it simply pops up reminder messages to register once in a while.&lt;br /&gt;
&lt;br /&gt;
===SciTE===&lt;br /&gt;
The current editor used by the majority of AutoIt users is SciTe, the AutoIt development team has created a custom version of SciTe with full syntax highlighting that also integrates various third-party AutoIt tools (like syntax checking and script tidying). A &amp;quot;lite&amp;quot; version of the SciTE editor comes with the AutoIt installation package. The full AutoIt version of SciTe that comes with all to tools can be downloaded seperately at http://www.autoitscript.com/autoit3/scite/&lt;br /&gt;
&lt;br /&gt;
===Crimson Editor===&lt;br /&gt;
[http://www.crimsoneditor.com/ Crimson Editor] is a free source code editor that supports syntax highlighting, customizable commands and pluggable extensions.&lt;br /&gt;
&lt;br /&gt;
===Notepad ++===&lt;br /&gt;
[http://notepad-plus.sourceforge.net/ NotePad ++] is a free/open source source code editor. It supports syntax highlighting, macros, etc. It uses the powerful Scintilla editor component. Now includes Syntax Highlighting for AutoIt by default.&lt;br /&gt;
&lt;br /&gt;
===jEdit===&lt;br /&gt;
[http://www.jedit.org/ jEdit] is an open source, Java based programmer&#039;s text editor. Some of its features include:&lt;br /&gt;
&lt;br /&gt;
* Written in Java, so it runs on Mac OS X, OS/2, Unix, VMS and Windows.&lt;br /&gt;
* Built-in macro language; extensible plugin architecture. Dozens of macros and plugins available.&lt;br /&gt;
* Plugins can be downloaded and installed from within jEdit using the &amp;quot;plugin manager&amp;quot; feature.&lt;br /&gt;
* Auto indent, and syntax highlighting for more than 130 languages.&lt;br /&gt;
* Supports a large number of character encodings including UTF8 and Unicode.&lt;br /&gt;
* Folding for selectively hiding regions of text.&lt;br /&gt;
* Word wrap.&lt;br /&gt;
* Highly configurable and customizable.&lt;br /&gt;
* Every other feature, both basic and advanced, you would expect to find in a text editor. See the [http://www.jedit.org/index.php?page=features features] page for a full list.&lt;br /&gt;
&lt;br /&gt;
===PSPad===&lt;br /&gt;
[http://www.pspad.com/en/ PSPad] is a freeware programmer&#039;s editor for Microsoft Windows operating systems, useful for people who:&lt;br /&gt;
&lt;br /&gt;
* work with various programming environments&lt;br /&gt;
* like highlighted syntax in their source code&lt;br /&gt;
* need a small tool with simple controls and the capabilities of a mighty code editor&lt;br /&gt;
* are looking for a tool that handles plain text&lt;br /&gt;
* want to save time - PSPad offers rich text formating functions&lt;br /&gt;
* need tool what offer user extension capabilities&lt;br /&gt;
* want to save money and still have the functionality of professional products because PSPad is free for commercial and government purposes too&lt;/div&gt;</summary>
		<author><name>Mdiesel</name></author>
	</entry>
</feed>