<?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=Skysnake</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=Skysnake"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/Skysnake"/>
	<updated>2026-05-13T15:03:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14402</id>
		<title>Snippets ( Files &amp; Folders )</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14402"/>
		<updated>2020-09-20T19:37:51Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Windows - Built In ZIP and Unzip (Windows Shell) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
[[category:Snippets]]&lt;br /&gt;
&lt;br /&gt;
{{Snippet Credit Header}}&lt;br /&gt;
&lt;br /&gt;
== _ConvertFileToUTF16 ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_ConvertFileToUTF16(@ScriptDir &amp;amp; &amp;quot;\Example.xml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func _ConvertFileToUTF16($sFilePath)&lt;br /&gt;
    Local $iEncoding = FileGetEncoding($sFilePath)&lt;br /&gt;
    Local $hFileOpen = FileOpen($sFilePath, $iEncoding)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $sData = FileRead($hFileOpen)&lt;br /&gt;
    FileClose($hFileOpen)&lt;br /&gt;
&lt;br /&gt;
    $hFileOpen = FileOpen($sFilePath, 2 + 32)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(2, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    FileWrite($hFileOpen, $sData)&lt;br /&gt;
    Return FileClose($hFileOpen)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ConvertFileToUTF16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== DropFiles ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
 | Desc = Dropping multiple files onto a GUI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Dropping multiple files onto a GUI&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global $__aDropFiles&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $hGUI = GUICreate(&#039;&#039;, 500, 500, -1, -1, -1, $WS_EX_ACCEPTFILES)&lt;br /&gt;
&lt;br /&gt;
	; Create a label that is transparent which will accept &#039;drop&#039; events.&lt;br /&gt;
	GUICtrlCreateLabel(&amp;quot;&amp;quot;, 0, 0, 500, 500)&lt;br /&gt;
	GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)&lt;br /&gt;
	GUICtrlSetResizing(-1, $GUI_DOCKALL)&lt;br /&gt;
	GUICtrlSetState(-1, $GUI_DROPACCEPTED)&lt;br /&gt;
&lt;br /&gt;
	GUIRegisterMsg($WM_DROPFILES, &amp;quot;WM_DROPFILES&amp;quot;)&lt;br /&gt;
	GUISetState(@SW_SHOW, $hGUI)&lt;br /&gt;
&lt;br /&gt;
	While 1&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
&lt;br /&gt;
			Case $GUI_EVENT_DROPPED&lt;br /&gt;
				If $__aDropFiles[0] &amp;gt; 0 Then&lt;br /&gt;
					_ArrayDisplay($__aDropFiles)&lt;br /&gt;
				EndIf&lt;br /&gt;
&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&lt;br /&gt;
Func WM_DROPFILES($hWnd, $iMsg, $iwParam, $ilParam)&lt;br /&gt;
	#forceref $hWnd, $ilParam&lt;br /&gt;
	Switch $iMsg&lt;br /&gt;
		Case $WM_DROPFILES&lt;br /&gt;
			Local $aReturn = _WinAPI_DragQueryFileEx($iwParam)&lt;br /&gt;
			If IsArray($aReturn) Then&lt;br /&gt;
				$__aDropFiles = $aReturn&lt;br /&gt;
			Else&lt;br /&gt;
				Local $aError[1] = [0]&lt;br /&gt;
				$__aDropFiles = $aError&lt;br /&gt;
			EndIf&lt;br /&gt;
	EndSwitch&lt;br /&gt;
	Return $GUI_RUNDEFMSG&lt;br /&gt;
EndFunc   ;==&amp;gt;WM_DROPFILES&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ExitCheckTextChange ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 8007-negativenrg&lt;br /&gt;
 | AuthorName = NegativeNrG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Check(when Exit), if Text is not equal to $e_to Then, prompt the user to save or not save.&lt;br /&gt;
;_ExitCheckText Change $Edit Handle, $title of messagebox, $message of messagebox, $equal to(default = NULL).&lt;br /&gt;
&lt;br /&gt;
Func _ExitCheckTextChange($E_hnd,$title,$message,$e_to = &#039;&#039;)&lt;br /&gt;
	Local $buffer, $choice, $filetosave, $handle1&lt;br /&gt;
                $buffer = GUIctrlread($E_hnd)&lt;br /&gt;
        If $buffer &amp;lt;&amp;gt; $e_to Then&lt;br /&gt;
            $choice = Msgbox(4,$title,$message)&lt;br /&gt;
            If $choice = 6 Then&lt;br /&gt;
                $filetosave = FileSaveDialog(&#039;Choose File&#039;,@scriptdir,&#039;(*.au3)&#039;)&lt;br /&gt;
                $handle1 = FileOpen($filetosave,2)&lt;br /&gt;
                FileWrite($handle1,$buffer)&lt;br /&gt;
                Exit&lt;br /&gt;
            Elseif $choice &amp;lt;&amp;gt; 6 Then&lt;br /&gt;
            Exit&lt;br /&gt;
        EndIf&lt;br /&gt;
        Else&lt;br /&gt;
        Exit&lt;br /&gt;
    EndIf&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileDeleteEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIFilesConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIFiles.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_FileDeleteEx(&amp;quot;C:\Example.dat&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileDeleteEx($sFilePath)&lt;br /&gt;
    Return FileDelete($sFilePath) = 1 ? 1 : Int(_WinAPI_MoveFileEx(FileGetShortName($sFilePath), &amp;quot;&amp;quot;, $MOVE_FILE_DELAY_UNTIL_REBOOT))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileDeleteEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCheck ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the file was modified less than 24 hours ago.&lt;br /&gt;
ConsoleWrite( _FileCheck(@ScriptFullPath, 24) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileCheck($sFilePath, $iHours = 24)&lt;br /&gt;
    Local $aTime&lt;br /&gt;
    If FileExists($sFilePath) = 0 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $aTime = FileGetTime($sFilePath, 0, 0)&lt;br /&gt;
    Return Number(_DateDiff(&amp;quot;h&amp;quot;, $aTime[0] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[1] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[2] &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aTime[3] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[4] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[5], @YEAR &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MON &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MDAY &amp;amp; &amp;quot; &amp;quot; &amp;amp; @HOUR &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @MIN &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @SEC) &amp;lt; $iHours)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCheck&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCreateEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_FileCreateEx(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 42)&lt;br /&gt;
&lt;br /&gt;
; Create a blank file with a certain size in bytes.&lt;br /&gt;
Func _FileCreateEx($sFilePath, $iBytes = 0)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c fsutil file createnew &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot; &#039; &amp;amp; Int($iBytes), @WorkingDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCreateEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileID ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FileClose(FileOpen(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 2))&lt;br /&gt;
ConsoleWrite(_FileID(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;) &amp;amp; @CRLF)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;)&lt;br /&gt;
&lt;br /&gt;
; Rerieve the file id of a filepath.&lt;br /&gt;
Func _FileID($sFilePath)&lt;br /&gt;
    Local $iPID = Run(@ComSpec &amp;amp; &#039; /c fsutil file queryfileid &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot;&#039;, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD), $sReturn = &#039;&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $sReturn &amp;amp;= StdoutRead($iPID)&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return StringStripWS(StringRegExpReplace($sReturn, &#039;File\sID\sis\s(.*?)&#039;, &#039;$1&#039;), 8)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileExistsWithQuotes ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&#039;&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;&amp;quot;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&amp;quot;&#039;&amp;quot; &amp;amp; @ScriptDir &amp;amp; &amp;quot;&#039;&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Check a filepath ecists even if the path contains quotation marks.&lt;br /&gt;
Func _FileExistsWithQuotes($sFilePath)&lt;br /&gt;
    Return FileExists(StringRegExpReplace($sFilePath, &#039;^(&amp;quot;|&#039;&#039;)*([^&amp;quot;&#039;&#039;]+)(&amp;quot;|&#039;&#039;)*$&#039;, &#039;\2&#039;))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileExistsWithQuotes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== FileLineCount ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 71214-mkish&lt;br /&gt;
 | AuthorName = MKISH&lt;br /&gt;
 | Desc = Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Author - MKISH&lt;br /&gt;
&lt;br /&gt;
; Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $FILE = &amp;quot;G:\WIN7\sources\boot.wim&amp;quot;&lt;br /&gt;
Local $COUNT = 0&lt;br /&gt;
Local $start = default&lt;br /&gt;
Local $res, $fLen, $err&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
	$res = _HexSearch($FILE, StringToBinary(&amp;quot;&amp;quot; &amp;amp; @crlf), $start)&lt;br /&gt;
	$start = $res + 2&lt;br /&gt;
	$COUNT = $COUNT + 1&lt;br /&gt;
	If $res = -1 then exitloop&lt;br /&gt;
Wend&lt;br /&gt;
&lt;br /&gt;
msgbox(64, &amp;quot;&amp;quot;, &amp;quot;Lines count: &amp;quot; &amp;amp; $COUNT)&lt;br /&gt;
&lt;br /&gt;
; _HexSearch function (originally written by Zinthose, modified by MKISH)&lt;br /&gt;
Func _HexSearch($FilePath, $BinaryValue, $StartOffset = Default)&lt;br /&gt;
        Local $Buffer, $ptr, $hFile, $Result, $Read, $SearchValue, $Pos, $BufferSize = 2048&lt;br /&gt;
            If $StartOffset = Default     Then $StartOffset = 0&lt;br /&gt;
            If Not FileExists($FilePath)    Then    Return SetError(1, @error, 0)&lt;br /&gt;
            $fLen = FileGetSize($FilePath)&lt;br /&gt;
            If $StartOffset &amp;gt; $fLen   Then   Return SetError(2, @error, 0)&lt;br /&gt;
            If Not IsBinary($BinaryValue)   Then    Return SetError(3, @error, 0)&lt;br /&gt;
            If Not IsNumber($StartOffset)   Then    Return SetError(4, @error, 0)&lt;br /&gt;
            $SearchValue = BinaryToString($BinaryValue)&lt;br /&gt;
            $Buffer = DllStructCreate(&amp;quot;byte[&amp;quot; &amp;amp; $BufferSize &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
            $ptr = DllStructGetPtr($Buffer)&lt;br /&gt;
                $hFile = _WinAPI_CreateFile($FilePath, 2, 2, 1)&lt;br /&gt;
                If $hFile = 0 Then Return SetError(5, @error, 0)&lt;br /&gt;
            $Result = _WinAPI_SetFilePointer($hFile, $StartOffset)&lt;br /&gt;
            $err = @error&lt;br /&gt;
            If $Result = 0xFFFFFFFF Then&lt;br /&gt;
                _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                Return SetError(5, $err, 0)&lt;br /&gt;
            EndIf&lt;br /&gt;
            $Pos = $StartOffset&lt;br /&gt;
            While True&lt;br /&gt;
                    $Read = 0&lt;br /&gt;
                    $Result = _WinAPI_ReadFile($hFile, $ptr, $BufferSize, $Read)&lt;br /&gt;
                    $err = @error&lt;br /&gt;
                    If Not $Result Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return SetError(6, $err, 0)&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Result = DllStructGetData($Buffer, 1)&lt;br /&gt;
                    $Result = BinaryToString($Result)&lt;br /&gt;
                    $Result = StringInStr($Result, $SearchValue)&lt;br /&gt;
                    If $Result &amp;gt; 0 Then ExitLoop&lt;br /&gt;
                    If $Read &amp;lt; $BufferSize Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return -1&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Pos += $Read&lt;br /&gt;
&lt;br /&gt;
            WEnd&lt;br /&gt;
            _WinAPI_CloseHandle($hFile)&lt;br /&gt;
            If Not $Result Then Return SetError(7, @error, 0)&lt;br /&gt;
            $Result = $Pos + $Result - 1&lt;br /&gt;
            Return $Result&lt;br /&gt;
    EndFunc; ==&amp;gt; _HexSearch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sFilePath = _FileOpenDialog(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)&amp;quot;, Random(1, @DesktopWidth, 1), Random(1, @DesktopHeight, 1), 1 + 4, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&#039;File = &#039; &amp;amp; $sFilePath &amp;amp; &#039;, @error = &#039; &amp;amp; @error &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: _FileOpenDialog&lt;br /&gt;
; Description ...: Initiates a Open File Dialog with the option to set the position of the GUI.&lt;br /&gt;
; Syntax ........: _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter[, $iLeft = -1[, $iTop = -1[, $iOptions = 0[,&lt;br /&gt;
;                  $sDefaultName = &amp;quot;&amp;quot;]]]])&lt;br /&gt;
; Parameters ....: $sTitle              - Title text of the Dialog GUI.&lt;br /&gt;
;                  $sIntitialDirectory  - Initial directory selected in the GUI file tree.&lt;br /&gt;
;                  $sFilter             - File type single filter such as &amp;quot;All (*.*)&amp;quot; or &amp;quot;Text files (*.txt)&amp;quot;.&lt;br /&gt;
;                  $iLeft               - [optional] The left side of the dialog box. By default (-1), the window is centered.&lt;br /&gt;
;                  $iTop                - [optional] The top of the dialog box. Default (-1) is centered&lt;br /&gt;
;                  $iOptions            - [optional] Dialog Options: To use more than one option, add the required values together. See FileOpenDialog. Default is 0.&lt;br /&gt;
;                  $sDefaultName        - [optional] Suggested file name for the user to open. Default is blank (&amp;quot;&amp;quot;).&lt;br /&gt;
; Return values .: Success: Returns the full path of the file(s) chosen. Results for multiple selections are &amp;quot;Directory|file1|file2|...&amp;quot;&lt;br /&gt;
;                  Failure: Sets @error to non-zero.&lt;br /&gt;
; Author ........: guinness&lt;br /&gt;
; Remarks........: This doesn&#039;t change the working directory of the script like FileOpenDialog does.&lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iLeft = -1, $iTop = -1, $iOptions = 0, $sDefaultName = &amp;quot;&amp;quot;)&lt;br /&gt;
    Local $hGUI = GUICreate(&#039;&#039;, -1, -1, $iLeft, $iTop), $sWorkingDir = @WorkingDir&lt;br /&gt;
    Local $sFilePath = FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iOptions, $sDefaultName, $hGUI)&lt;br /&gt;
    Local $iError = @error&lt;br /&gt;
    FileChangeDir($sWorkingDir)&lt;br /&gt;
    Return SetError($iError, GUIDelete($hGUI), $sFilePath)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileRename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 52374-johnone&lt;br /&gt;
 | AuthorName = JohnOne&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;### Rename a file ###&lt;br /&gt;
;$sFile = Full path to file&lt;br /&gt;
;$sRename = New Filename&lt;br /&gt;
;$iOverWrite = 0 or 1&lt;br /&gt;
&lt;br /&gt;
;Success returns 1&lt;br /&gt;
;failure, returns 0 and sets @error&lt;br /&gt;
; 1 if FileMove fails, &lt;br /&gt;
; 2 if $sFile does not exist&lt;br /&gt;
;@extended&lt;br /&gt;
; 0 if the new file does not already exist / existed&lt;br /&gt;
; 1 if the new file already exists / existed&lt;br /&gt;
&lt;br /&gt;
;#### Example ####&lt;br /&gt;
$File = @ScriptDir &amp;amp; &#039;\filetorename.txt&#039;&lt;br /&gt;
FileWrite($File, &#039;Test&#039;)&lt;br /&gt;
_FileRename($File, &#039;newname.txt&#039;)&lt;br /&gt;
If @error Then MsgBox(0, &amp;quot;Error&amp;quot;, @error)&lt;br /&gt;
&lt;br /&gt;
Func _FileRename($sFile, $sRename, $iOverWrite = 0)&lt;br /&gt;
    Local Const $FILENOTEXIST = 2&lt;br /&gt;
    If Not FileExists($sFile) Then Return SetError($FILENOTEXIST, 0, 0)&lt;br /&gt;
    Local $_StringLen = StringLen($sFile)&lt;br /&gt;
    Local $_StringInStr = StringInStr($sFile, &amp;quot;\&amp;quot;, 0, -1, $_StringLen)&lt;br /&gt;
    Local $_Count = $_StringLen - $_StringInStr&lt;br /&gt;
    Local $_Dir = StringLeft($sFile, $_StringInStr)&lt;br /&gt;
    Local $_NewFile = $_Dir &amp;amp; $sRename&lt;br /&gt;
    Local $_NewFileExists = FileExists($_NewFile)&lt;br /&gt;
    Local $_FileMove = FileMove($sFile, $_NewFile, $iOverWrite)&lt;br /&gt;
    Return SetError(Not $_FileMove, $_NewFileExists, $_FileMove)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileRename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== _FileRename Alternative ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;FileRename(PathFile, RenameFile)&lt;br /&gt;
;JohnOne&lt;br /&gt;
&lt;br /&gt;
FileRename(@ScriptDir &amp;amp; &amp;quot;\rename.txt&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\renamed.txt&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func FileRename($FileName, $ReName)&lt;br /&gt;
&lt;br /&gt;
	Local $SHFILEOPSTRUCT, $SourceStruct, $DestStruct&lt;br /&gt;
	Local Const $FO_RENAME = 0x0004&lt;br /&gt;
	Local Const $FOF_SILENT = 0x0004&lt;br /&gt;
	Local Const $FOF_NOCONFIRMATION = 0x0010&lt;br /&gt;
	Local Const $FOF_NOERRORUI = 0x0400&lt;br /&gt;
	Local Const $FOF_NOCONFIRMMKDIR = 0x0200&lt;br /&gt;
	Local Const $NULL = 0&lt;br /&gt;
&lt;br /&gt;
	$SourceStruct = _StringToStruct($FileName)&lt;br /&gt;
	$DestStruct = _StringToStruct($ReName)&lt;br /&gt;
&lt;br /&gt;
	$SHFILEOPSTRUCT = DllStructCreate(&amp;quot;hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hWnd&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;wFunc&amp;quot;, $FO_RENAME)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pFrom&amp;quot;, DllStructGetPtr($SourceStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pTo&amp;quot;, DllStructGetPtr($DestStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fFlags&amp;quot;, BitOR($FOF_SILENT, $FOF_NOCONFIRMATION, $FOF_NOERRORUI, $FOF_NOCONFIRMMKDIR))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fAnyOperationsAborted&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hNameMappings&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;lpszProgressTitle&amp;quot;, $NULL)&lt;br /&gt;
&lt;br /&gt;
	$acall = DllCall(&amp;quot;shell32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;SHFileOperation&amp;quot;, &amp;quot;ptr&amp;quot;, DllStructGetPtr($SHFILEOPSTRUCT))&lt;br /&gt;
	If @error Then&lt;br /&gt;
		Return SetError(@error, @extended, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;FileRename&lt;br /&gt;
&lt;br /&gt;
Func _StringToStruct($string)&lt;br /&gt;
&lt;br /&gt;
	Local $iLen = StringLen($string)&lt;br /&gt;
	Local $Struct = DllStructCreate(&amp;quot;char[&amp;quot; &amp;amp; String($iLen + 2) &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
	DllStructSetData($Struct, 1, $string)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 1)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 2)&lt;br /&gt;
&lt;br /&gt;
	Return $Struct&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringToStruct&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Below&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath.&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $aArray = StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)&lt;br /&gt;
    Return $aArray[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Above&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath. Works with V3.3.5.4+&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsDir ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a file - &amp;quot; &amp;amp; IsDir(@ScriptFullPath) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a directory - &amp;quot; &amp;amp; IsDir(@ScriptDir) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
&lt;br /&gt;
Func IsDir($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) &amp;gt; 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsDir&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a file - &#039; &amp;amp; IsFile(@ScriptFullPath) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a directory - &#039; &amp;amp; IsFile(@ScriptDir) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
&lt;br /&gt;
Func IsFile($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) = 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsFilee&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileDiff ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return False as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return True as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is different.&lt;br /&gt;
Func _IsFileDiff($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileDiff&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileOlder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt; ; Required for _DateDiff()&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the current script is older than 10 days.&lt;br /&gt;
If _IsFileOlder(@ScriptFullPath, 10) Then&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File is older than 10 days.&#039;)&lt;br /&gt;
Else&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File isn&#039;&#039;t older than 10 days.&#039;)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
; Is a file older than a certain number of days.&lt;br /&gt;
Func _IsFileOlder($sFilePath, $iDays)&lt;br /&gt;
	Local $aArray = FileGetTime($sFilePath, $FT_CREATED)&lt;br /&gt;
	Return _DateDiff(&#039;D&#039;, $aArray[0] &amp;amp; &#039;/&#039; &amp;amp; $aArray[1] &amp;amp; &#039;/&#039; &amp;amp; $aArray[2] &amp;amp; &#039; &#039; &amp;amp; $aArray[3] &amp;amp; &#039;:&#039; &amp;amp; $aArray[4] &amp;amp; &#039;:&#039; &amp;amp; $aArray[5], @YEAR &amp;amp; &#039;/&#039; &amp;amp; @MON &amp;amp; &#039;/&#039; &amp;amp; @MDAY &amp;amp; &#039; &#039; &amp;amp; @HOUR &amp;amp; &#039;:&#039; &amp;amp; @MIN &amp;amp; &#039;:&#039; &amp;amp; @SEC) &amp;gt;= $iDays&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileOlder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileSame ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return True as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return False as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is the same.&lt;br /&gt;
Func _IsFileSame($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) = 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileSame&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__INIFileFill(@ScriptDir &amp;amp; &#039;\Example.ini&#039;) ; Create an INI file with random data.&lt;br /&gt;
&lt;br /&gt;
Local $aArray = _IniReadFile(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
_ArrayDisplay($aArray)&lt;br /&gt;
&lt;br /&gt;
Func _IniReadFile($sFilePath)&lt;br /&gt;
    Local $aReturn[1][3] = [[0, 3]], $aSectionArray, $aSectionNameArray, $iCount = 0&lt;br /&gt;
    $aSectionNameArray = IniReadSectionNames($sFilePath)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, $aReturn)&lt;br /&gt;
    EndIf&lt;br /&gt;
    For $A = 1 To $aSectionNameArray[0]&lt;br /&gt;
        $aSectionArray = IniReadSection($sFilePath, $aSectionNameArray[$A])&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ContinueLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
        For $B = 1 To $aSectionArray[0][0]&lt;br /&gt;
            $aReturn[0][0] += 1&lt;br /&gt;
            $iCount += 1&lt;br /&gt;
            If $aReturn[0][0] &amp;lt;= $iCount + 1 Then&lt;br /&gt;
                ReDim $aReturn[$aReturn[0][0] * 2][$aReturn[0][1]]&lt;br /&gt;
            EndIf&lt;br /&gt;
            $aReturn[$iCount][0] = $aSectionArray[$B][0]&lt;br /&gt;
            $aReturn[$iCount][1] = $aSectionArray[$B][1]&lt;br /&gt;
            $aReturn[$iCount][2] = $aSectionNameArray[$A]&lt;br /&gt;
        Next&lt;br /&gt;
    Next&lt;br /&gt;
    ReDim $aReturn[$aReturn[0][0] + 1][$aReturn[0][1]] ; Remove empty entries.&lt;br /&gt;
    Return $aReturn&lt;br /&gt;
EndFunc   ;==&amp;gt;_IniReadFile&lt;br /&gt;
&lt;br /&gt;
Func __INIFileFill($sFilePath)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sHeader = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    For $i = 1 To Random(1, 5, 1)&lt;br /&gt;
        $sHeader = _RandomText(Random(5, 25, 1))&lt;br /&gt;
        $sData = &amp;quot;&amp;quot;&lt;br /&gt;
        For $j = 1 To Random(1, 25, 1)&lt;br /&gt;
            $sData &amp;amp;= _RandomText(Random(5, 25, 1)) &amp;amp; &#039;=&#039; &amp;amp; _RandomText(Random(5, 25, 1)) &amp;amp; @LF&lt;br /&gt;
        Next&lt;br /&gt;
        IniWriteSection($sFilePath, $sHeader, $sData)&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc   ;==&amp;gt;__FillINIFile&lt;br /&gt;
&lt;br /&gt;
Func _RandomText($iLength = 10)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sRandom = &#039;&#039;&lt;br /&gt;
    For $i = 1 To $iLength&lt;br /&gt;
        $sRandom = Random(55, 116, 1)&lt;br /&gt;
        $sData &amp;amp;= Chr($sRandom + 6 * ($sRandom &amp;gt; 90) - 7 * ($sRandom &amp;lt; 65))&lt;br /&gt;
    Next&lt;br /&gt;
    Return $sData&lt;br /&gt;
EndFunc   ;==&amp;gt;_RandomText&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadInit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 9370-mlowery&lt;br /&gt;
 | AuthorName = mlowery&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;===============================================================================&lt;br /&gt;
; Description:     Reads values from INI or creates INI with initial values.&lt;br /&gt;
;                  Intended to ensure all available INI settings are exposed&lt;br /&gt;
;                  and editable.&lt;br /&gt;
;                  Parameters are identical to IniRead()&lt;br /&gt;
; Parameter(s):    $filename  = filename of INI&lt;br /&gt;
;                  $section  = section name of INI&lt;br /&gt;
;                  $key      = key name in section&lt;br /&gt;
;                  $default  = default value (written to INI if not exists)&lt;br /&gt;
; Requirement(s):  None&lt;br /&gt;
; Return Value(s): Returns value from INI (or default if not defined)&lt;br /&gt;
; Note(s):         Chr(127) used to detect non-existing value since won&#039;t normally exist in a text file&lt;br /&gt;
;===============================================================================&lt;br /&gt;
Func _IniReadInit($filename, $section, $key, $default)&lt;br /&gt;
  Local $value = IniRead($filename, $section, $key, Chr(127))&lt;br /&gt;
    If $value = Chr(127) Then&lt;br /&gt;
      IniWrite($filename, $section, $key, $default)&lt;br /&gt;
      $value = $default&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return $value&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsValidFileType ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;) ; By AZJIO - http://www.autoitscript.com/forum/topic/...filetype/page__view__findpost_&lt;br /&gt;
    Local $iDot = StringInStr($sFilePath, &amp;quot;.&amp;quot;, 0, -1)&lt;br /&gt;
    Return $iDot And StringInStr(&#039;;&#039; &amp;amp; $sList &amp;amp; &#039;;&#039;, &#039;;&#039; &amp;amp; StringTrimLeft($sFilePath, $iDot) &amp;amp; &#039;;&#039;) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Example 2&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;, $iOpFast = 1) ; By Yashied.&lt;br /&gt;
    If StringStripWS($sList, 8) = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $sList = &amp;quot;*&amp;quot;&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return _WinAPI_PathMatchSpec($sFilePath, StringReplace(&#039;;&#039; &amp;amp; $sList, &#039;;&#039;, &#039;;*.&#039;, 0, $iOpFast * 2))&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== File Open/Save/Folder Dialog Box ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
 | AuthorURL2 = 4997-odklizec&lt;br /&gt;
 | AuthorName2 = odklizec&lt;br /&gt;
 | AuthorURL3 = 6756-danny35d&lt;br /&gt;
 | AuthorName3 = Danny35d&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Center - File Open/Save/Folder Dialog Box&lt;br /&gt;
; Author - odklizec, MHz, Danny35d&lt;br /&gt;
&lt;br /&gt;
 If StringInStr($cmdlineraw, &#039;/MoveWin&#039;) Then&lt;br /&gt;
	 Local $size, $PosX, $PosY&lt;br /&gt;
     $cmdlineraw = StringSplit(StringMid($cmdlineraw, StringInStr($cmdlineraw, &#039;/MoveWin&#039;)), &#039;:&#039;)&lt;br /&gt;
     While 1&lt;br /&gt;
         Select&lt;br /&gt;
         Case WinExists($cmdlineraw[2])&lt;br /&gt;
             $size=WinGetPos ($cmdlineraw[2])&lt;br /&gt;
             $PosX=@DesktopWidth/2 - $size[2]/2&lt;br /&gt;
             $PosY=@DesktopHeight/2 - $size[3]/2&lt;br /&gt;
             WinMove($cmdlineraw[2], &amp;quot;&amp;quot;, $PosX, $PosY)&lt;br /&gt;
             WinActivate($cmdlineraw[2])&lt;br /&gt;
             ExitLoop&lt;br /&gt;
         EndSelect&lt;br /&gt;
         Sleep(50)&lt;br /&gt;
     WEnd&lt;br /&gt;
     Exit&lt;br /&gt;
 EndIf&lt;br /&gt;
Global $PID, $Read_File, $Save_File&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Open file Dialog Box&#039;)&lt;br /&gt;
 $Read_File = FileOpenDialog ( &amp;quot;Open file Dialog Box&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;AutoIt Files (*.au3)&amp;quot;,3,@ScriptFullPath)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Save file Dialog Box&#039;)&lt;br /&gt;
 $Save_File = FileSaveDialog( &amp;quot;Save file Dialog Box&amp;quot;, @ScriptDir, &amp;quot;Scripts (*.aut;*.au3)&amp;quot;, 3)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Browse for Folder&#039;)&lt;br /&gt;
 FileSelectFolder(&amp;quot;Choose a folder with plugins..&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;4&amp;quot;,&amp;quot;c:\&amp;quot;)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
&lt;br /&gt;
 Func _FindBrowseWin($sTitle)&lt;br /&gt;
     If @Compiled Then&lt;br /&gt;
         Return(Run(@ScriptFullPath &amp;amp; &#039; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     Else&lt;br /&gt;
         Return(Run(@AutoItExe &amp;amp; &#039; &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     EndIf&lt;br /&gt;
 EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MoveFileOnReboot ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 44525-jscript&lt;br /&gt;
 | AuthorName = JScript&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Author: JScript - Snippet Version No. = 1.0&lt;br /&gt;
;Snippet was Created Using AutoIt Version = 3.3.2.0, Creation Date = 21/03/12.&lt;br /&gt;
&lt;br /&gt;
; Function to Move or Delete a file on next reboot!&lt;br /&gt;
Func _MoveFileOnReboot($sSourcePath, $sDestPath = &amp;quot;&amp;quot;); If $sDestPath = &amp;quot;&amp;quot; the file is deleted instead of moved.&lt;br /&gt;
    Local $iRet&lt;br /&gt;
&lt;br /&gt;
    ; PendingFileRenameOperations (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager)&lt;br /&gt;
    If $DestPath = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;int&amp;quot;, 0, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    Else&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;str&amp;quot;, $sDestPath, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Return $iRet&lt;br /&gt;
EndFunc   ;==&amp;gt;_MoveFileOnReboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MultipleFileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL =&lt;br /&gt;
 | AuthorName = /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $message = &amp;quot;Hold down Ctrl or Shift to choose multiple files.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Local $filename = _MultipleFileOpenDialog($message,300,300)&lt;br /&gt;
&lt;br /&gt;
Local $var = FileOpenDialog($message, @WindowsDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)&amp;quot;, 1 + 4 )&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;No File(s) chosen&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    $var = StringReplace($var, &amp;quot;|&amp;quot;, @CRLF)&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;You chose &amp;quot; &amp;amp; $var)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
FileDelete($filename)&lt;br /&gt;
func _MultipleFileOpenDialog($title,$posx,$posy)&lt;br /&gt;
    Local $temp = EnvGet(&amp;quot;temp&amp;quot;)&lt;br /&gt;
    Local $filename = $temp &amp;amp; &amp;quot;\move_file_open_dialog.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Local $script = &#039;Global $title = &amp;quot;&#039; &amp;amp; $title &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_x = &#039; &amp;amp; $posx &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_y = &#039; &amp;amp; $posy &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;AdlibRegister(&amp;quot;_Move&amp;quot;,10)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;while 1&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;    sleep(1000)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;wend&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Func _Move()&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   if (WinActive($title)) Then&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      WinMove($title,&amp;quot;&amp;quot;,$pos_x,$pos_y)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      Exit&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   EndIf&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;EndFunc&#039; &amp;amp; @CRLF&lt;br /&gt;
&lt;br /&gt;
    FileWrite($filename,$script)&lt;br /&gt;
    ;MsgBox(0,&amp;quot;&amp;quot;,$script &amp;amp; @CRLF &amp;amp; $filename)&lt;br /&gt;
    Run(@AutoItExe &amp;amp; &amp;quot; /AutoIt3ExecuteScript &amp;quot; &amp;amp; $filename)&lt;br /&gt;
    sleep(250)&lt;br /&gt;
    Return $filename&lt;br /&gt;
EndFunc ;==&amp;gt;_MultipleFileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _OpenFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
    These have been declared in Global scope as you may wish to use them elsewhere in your script.&lt;br /&gt;
#ce&lt;br /&gt;
Global $ALTSTARTUP = 0x1d&lt;br /&gt;
Global $APPDATA = 0x1a&lt;br /&gt;
Global $BITBUCKET = 0x0a&lt;br /&gt;
Global $COMMONALTSTARTUP = 0x1e&lt;br /&gt;
Global $COMMONAPPDATA = 0x23&lt;br /&gt;
Global $COMMONDESKTOPDIR = 0x19&lt;br /&gt;
Global $COMMONFAVORITES = 0x1f&lt;br /&gt;
Global $COMMONPROGRAMS = 0x17&lt;br /&gt;
Global $COMMONSTARTMENU = 0x16&lt;br /&gt;
Global $COMMONSTARTUP = 0x18&lt;br /&gt;
Global $CONTROLS = 0x03&lt;br /&gt;
Global $COOKIES = 0x21&lt;br /&gt;
Global $DESKTOP = 0x00&lt;br /&gt;
Global $DESKTOPDIRECTORY = 0x10&lt;br /&gt;
Global $DRIVES = 0x11&lt;br /&gt;
Global $FAVORITES = 0x06&lt;br /&gt;
Global $FONTS = 0x14&lt;br /&gt;
Global $HISTORY = 0x22&lt;br /&gt;
Global $INTERNETCACHE = 0x20&lt;br /&gt;
Global $LOCALAPPDATA = 0x1c&lt;br /&gt;
Global $MYPICTURES = 0x27&lt;br /&gt;
Global $NETHOOD = 0x13&lt;br /&gt;
Global $NETWORK = 0x12&lt;br /&gt;
Global $PERSONAL = 0x05&lt;br /&gt;
Global $PRINTERS = 0x04&lt;br /&gt;
Global $PRINTHOOD = 0x1b&lt;br /&gt;
Global $PROFILE = 0x28&lt;br /&gt;
Global $PROGRAMFILES = 0x26&lt;br /&gt;
Global $PROGRAMFILESx86 = 0x30&lt;br /&gt;
Global $PROGRAMS = 0x02&lt;br /&gt;
Global $RECENT = 0x08&lt;br /&gt;
Global $SENDTO = 0x09&lt;br /&gt;
Global $STARTMENU = 0x0b&lt;br /&gt;
Global $STARTUP = 0x07&lt;br /&gt;
Global $SYSTEM = 0x25&lt;br /&gt;
Global $SYSTEMx86 = 0x29&lt;br /&gt;
Global $TEMPLATES = 0x15&lt;br /&gt;
Global $WINDOWS = 0x24&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_OpenFolder(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_OpenFolder($PRINTERS) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Open a folder or special folder variable, similar to using ShellExecute.&lt;br /&gt;
Func _OpenFolder($sFolderPath)&lt;br /&gt;
    Local $oShell = ObjCreate(&#039;shell.application&#039;)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $oShell.Open($sFolderPath)&lt;br /&gt;
    Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_OpenFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathAppendToFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sOrg = &amp;quot;C:\Some.Folder\some.file.ext&amp;quot;&lt;br /&gt;
$sAdd = &amp;quot;_backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$sNew = _PathAppendToFilename($sOrg, $sAdd)&lt;br /&gt;
&lt;br /&gt;
$sStripped = _PathStripRightFromFilename($sNew, $sAdd)&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &amp;quot;&amp;quot;, $sOrg &amp;amp; @CRLF &amp;amp; $sAdd &amp;amp; @CRLF &amp;amp; $sNew &amp;amp; @CRLF &amp;amp; $sStripped)&lt;br /&gt;
&lt;br /&gt;
Func _PathAppendToFilename($sName, $sAppend)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sAppend, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;(\.[^\\/\.]+)$&amp;quot;, $sAppend &amp;amp; &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathStripRightFromFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _PathStripRightFromFilename($sName, $sStrip)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sStrip, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;\Q&amp;quot; &amp;amp; $sStrip &amp;amp; &amp;quot;\E(\.[^\\/\.]+)$&amp;quot;, &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SelfDelete ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This also removes the directory which the file is in&lt;br /&gt;
; Author MHz with the directory delete addition by The Kandie Man&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
    Local $sCmdFile&lt;br /&gt;
    FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
    $sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039;127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;rmdir /q &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot; goto loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &#039; &amp;amp; @TempDir &amp;amp; &#039;\scratch.bat&#039;&lt;br /&gt;
    FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
    Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ShellExecuteFileSelectFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_ShellExecuteFileSelectFolder(&#039;Select a Folder&#039;, @HomeDrive) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Shell Execute a selected folder.&lt;br /&gt;
Func _ShellExecuteFileSelectFolder($sText, $sRoot, $iFlag = 0, $sInitialDir = &#039;&#039;, $hWnd = &#039;&#039;)&lt;br /&gt;
    Local $sFolder = FileSelectFolder($sText, $sRoot, $iFlag, $sInitialDir, $hWnd)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(@error, @extended, &#039;&#039;)&lt;br /&gt;
    EndIf&lt;br /&gt;
    ShellExecute($sFolder)&lt;br /&gt;
    Return $sFolder&lt;br /&gt;
EndFunc   ;==&amp;gt;_ShellExecuteFileSelectFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SuiCide ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 28010-larrydalooza&lt;br /&gt;
 | AuthorName = LarryDalooza&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION&lt;br /&gt;
; Deletes the running script&lt;br /&gt;
&lt;br /&gt;
Func SuiCide()&lt;br /&gt;
	Local $sFilePath = @TempDir &amp;amp; &#039;\SuiCide.bat&#039;&lt;br /&gt;
	FileDelete($sFilePath)&lt;br /&gt;
	FileWrite($sFilePath, &#039;loop:&#039; &amp;amp; @CRLF &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;ping -n 1 -w 250 zxywqxz_q&#039; &amp;amp; @CRLF &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; _&lt;br /&gt;
			&#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF &amp;amp; &#039;del SuiCide.bat&#039; &amp;amp; @CRLF)&lt;br /&gt;
	Exit Run($sFilePath, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;SuiCide&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _UniqueFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_UniqueFilename(@ScriptDir, &#039;.au3&#039;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _UniqueFilename($sFilePath, $sExtension)&lt;br /&gt;
    Local $iRandom = 0, $sUnqiueFileName = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $sExtension = &#039;.&#039; &amp;amp; StringRegExpReplace($sExtension, &#039;\A[\.]+&#039;, &#039;&#039;)&lt;br /&gt;
    $sFilePath = StringRegExpReplace($sFilePath, &#039;[\\/]+\z&#039;, &#039;&#039;) &amp;amp; &#039;\&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $iRandom = Random(55, 116, 1)&lt;br /&gt;
        $sUnqiueFileName &amp;amp;= Chr($iRandom + 6 * ($iRandom &amp;gt; 90) - 7 * ($iRandom &amp;lt; 65))&lt;br /&gt;
        If FileExists($sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension) = 0 And StringLen($sUnqiueFileName) &amp;gt; 7 Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return $sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension&lt;br /&gt;
EndFunc   ;==&amp;gt;_UniqueFilename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== Windows - Copy With Progress ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 19-jos&lt;br /&gt;
 | AuthorName = Jos&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Windows - Copy With Progress&lt;br /&gt;
&lt;br /&gt;
;~ 4 Do not display a progress dialog box.&lt;br /&gt;
;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.&lt;br /&gt;
;~ 16 Respond with &amp;quot;Yes to All&amp;quot; for any dialog box that is displayed.&lt;br /&gt;
;~ 64 Preserve undo information, if possible.&lt;br /&gt;
;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.&lt;br /&gt;
;~ 256 Display a progress dialog box but do not show the file names.&lt;br /&gt;
;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.&lt;br /&gt;
;~ 1024 Do not display a user interface if an error occurs.&lt;br /&gt;
;~ 2048 Version 4.71. Do not copy the security attributes of the file.&lt;br /&gt;
;~ 4096 Only operate in the local directory. Don&#039;t operate recursively into subdirectories.&lt;br /&gt;
;~ 8192 Version 5.0. Do not copy connected files as a group. Only copy the specified files.&lt;br /&gt;
&lt;br /&gt;
_FileCopy(&amp;quot;C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe&amp;quot;,&amp;quot;C:\temp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
; to copy a directory the destination directory must exist&lt;br /&gt;
&lt;br /&gt;
Func _FileCopy($fromFile,$tofile)&lt;br /&gt;
    Local $FOF_RESPOND_YES = 16&lt;br /&gt;
    Local $FOF_SIMPLEPROGRESS = 256&lt;br /&gt;
    $winShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Windows - Built In ZIP and Unzip (Windows Shell) ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
  | AuthorName = Nine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;String.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Const $sZipFile = @ScriptDir &amp;amp; &amp;quot;\Test.zip&amp;quot;&lt;br /&gt;
Const $sFolder = @ScriptDir &amp;amp; &amp;quot;\Temp&amp;quot;&lt;br /&gt;
Const $sZipNew = @ScriptDir &amp;amp; &amp;quot;\Test2.zip&amp;quot;&lt;br /&gt;
&lt;br /&gt;
DirRemove ($sFolder, $DIR_REMOVE)&lt;br /&gt;
UnZip($sZipFile, $sFolder)&lt;br /&gt;
If @error Then Exit MsgBox ($MB_SYSTEMMODAL,&amp;quot;&amp;quot;,&amp;quot;Error unzipping files : &amp;quot; &amp;amp; @error)&lt;br /&gt;
FileDelete ($sZipNew)&lt;br /&gt;
Zip ($sZipNew, $sFolder)&lt;br /&gt;
If @error Then Exit MsgBox ($MB_SYSTEMMODAL,&amp;quot;&amp;quot;,&amp;quot;Error zipping files : &amp;quot; &amp;amp; @error)&lt;br /&gt;
&lt;br /&gt;
Func UnZip($sZipFile, $sDestFolder)&lt;br /&gt;
  If Not FileExists($sZipFile) Then Return SetError (1) ; source file does not exists&lt;br /&gt;
  If Not FileExists($sDestFolder) Then&lt;br /&gt;
    If Not DirCreate($sDestFolder) Then Return SetError (2) ; unable to create destination&lt;br /&gt;
  Else&lt;br /&gt;
    If Not StringInStr(FileGetAttrib($sDestFolder), &amp;quot;D&amp;quot;) Then Return SetError (3) ; destination not folder&lt;br /&gt;
  EndIf&lt;br /&gt;
  Local $oShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
  Local $oZip = $oShell.NameSpace($sZipFile)&lt;br /&gt;
  Local $iZipFileCount = $oZip.items.Count&lt;br /&gt;
  If Not $iZipFileCount Then Return SetError (4) ; zip file empty&lt;br /&gt;
  For $oFile In $oZip.items&lt;br /&gt;
    $oShell.NameSpace($sDestFolder).copyhere($ofile)&lt;br /&gt;
  Next&lt;br /&gt;
EndFunc   ;==&amp;gt;UnZip&lt;br /&gt;
&lt;br /&gt;
Func Zip ($sZipFile, $sSourceFolder)&lt;br /&gt;
  If FileExists($sZipFile) Then Return SetError (1) ; destination file already exists&lt;br /&gt;
  If Not FileExists($sSourceFolder) Then Return SetError (2) ; source does not exist&lt;br /&gt;
  Local $hFile = FileOpen ($sZipFile, $FO_CREATEPATH+$FO_OVERWRITE+$FO_BINARY)&lt;br /&gt;
  Local Const $sString = Chr(80) &amp;amp; Chr(75) &amp;amp; Chr(5) &amp;amp; Chr(6) &amp;amp; _StringRepeat (Chr(0), 18) ; create ZIP file signature&lt;br /&gt;
  FileWrite ($hFile, $sString)&lt;br /&gt;
  FileClose($hFile)&lt;br /&gt;
  Local $oShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
  If Not $oShell.NameSpace ($sSourceFolder).items.count Then Return SetError (3) ; folder empty&lt;br /&gt;
  Local $iFiles = 0&lt;br /&gt;
  For $oFile In $oShell.NameSpace($sSourceFolder).items&lt;br /&gt;
    $oShell.NameSpace($sZipFile).copyhere($oFile)&lt;br /&gt;
    Do&lt;br /&gt;
      Sleep (100) ; let the file being copied to ZIP&lt;br /&gt;
    Until $oShell.NameSpace($sZipFile).items.count &amp;gt; $iFiles&lt;br /&gt;
    $iFiles = $oShell.NameSpace($sZipFile).items.count&lt;br /&gt;
  Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14391</id>
		<title>Snippets ( Files &amp; Folders )</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14391"/>
		<updated>2020-09-01T12:14:00Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Windows - Built In Unzip (Windows Shell) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
[[category:Snippets]]&lt;br /&gt;
&lt;br /&gt;
{{Snippet Credit Header}}&lt;br /&gt;
&lt;br /&gt;
== _ConvertFileToUTF16 ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_ConvertFileToUTF16(@ScriptDir &amp;amp; &amp;quot;\Example.xml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func _ConvertFileToUTF16($sFilePath)&lt;br /&gt;
    Local $iEncoding = FileGetEncoding($sFilePath)&lt;br /&gt;
    Local $hFileOpen = FileOpen($sFilePath, $iEncoding)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $sData = FileRead($hFileOpen)&lt;br /&gt;
    FileClose($hFileOpen)&lt;br /&gt;
&lt;br /&gt;
    $hFileOpen = FileOpen($sFilePath, 2 + 32)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(2, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    FileWrite($hFileOpen, $sData)&lt;br /&gt;
    Return FileClose($hFileOpen)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ConvertFileToUTF16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== DropFiles ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
 | Desc = Dropping multiple files onto a GUI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Dropping multiple files onto a GUI&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global $__aDropFiles&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $hGUI = GUICreate(&#039;&#039;, 500, 500, -1, -1, -1, $WS_EX_ACCEPTFILES)&lt;br /&gt;
&lt;br /&gt;
	; Create a label that is transparent which will accept &#039;drop&#039; events.&lt;br /&gt;
	GUICtrlCreateLabel(&amp;quot;&amp;quot;, 0, 0, 500, 500)&lt;br /&gt;
	GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)&lt;br /&gt;
	GUICtrlSetResizing(-1, $GUI_DOCKALL)&lt;br /&gt;
	GUICtrlSetState(-1, $GUI_DROPACCEPTED)&lt;br /&gt;
&lt;br /&gt;
	GUIRegisterMsg($WM_DROPFILES, &amp;quot;WM_DROPFILES&amp;quot;)&lt;br /&gt;
	GUISetState(@SW_SHOW, $hGUI)&lt;br /&gt;
&lt;br /&gt;
	While 1&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
&lt;br /&gt;
			Case $GUI_EVENT_DROPPED&lt;br /&gt;
				If $__aDropFiles[0] &amp;gt; 0 Then&lt;br /&gt;
					_ArrayDisplay($__aDropFiles)&lt;br /&gt;
				EndIf&lt;br /&gt;
&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&lt;br /&gt;
Func WM_DROPFILES($hWnd, $iMsg, $iwParam, $ilParam)&lt;br /&gt;
	#forceref $hWnd, $ilParam&lt;br /&gt;
	Switch $iMsg&lt;br /&gt;
		Case $WM_DROPFILES&lt;br /&gt;
			Local $aReturn = _WinAPI_DragQueryFileEx($iwParam)&lt;br /&gt;
			If IsArray($aReturn) Then&lt;br /&gt;
				$__aDropFiles = $aReturn&lt;br /&gt;
			Else&lt;br /&gt;
				Local $aError[1] = [0]&lt;br /&gt;
				$__aDropFiles = $aError&lt;br /&gt;
			EndIf&lt;br /&gt;
	EndSwitch&lt;br /&gt;
	Return $GUI_RUNDEFMSG&lt;br /&gt;
EndFunc   ;==&amp;gt;WM_DROPFILES&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ExitCheckTextChange ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 8007-negativenrg&lt;br /&gt;
 | AuthorName = NegativeNrG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Check(when Exit), if Text is not equal to $e_to Then, prompt the user to save or not save.&lt;br /&gt;
;_ExitCheckText Change $Edit Handle, $title of messagebox, $message of messagebox, $equal to(default = NULL).&lt;br /&gt;
&lt;br /&gt;
Func _ExitCheckTextChange($E_hnd,$title,$message,$e_to = &#039;&#039;)&lt;br /&gt;
	Local $buffer, $choice, $filetosave, $handle1&lt;br /&gt;
                $buffer = GUIctrlread($E_hnd)&lt;br /&gt;
        If $buffer &amp;lt;&amp;gt; $e_to Then&lt;br /&gt;
            $choice = Msgbox(4,$title,$message)&lt;br /&gt;
            If $choice = 6 Then&lt;br /&gt;
                $filetosave = FileSaveDialog(&#039;Choose File&#039;,@scriptdir,&#039;(*.au3)&#039;)&lt;br /&gt;
                $handle1 = FileOpen($filetosave,2)&lt;br /&gt;
                FileWrite($handle1,$buffer)&lt;br /&gt;
                Exit&lt;br /&gt;
            Elseif $choice &amp;lt;&amp;gt; 6 Then&lt;br /&gt;
            Exit&lt;br /&gt;
        EndIf&lt;br /&gt;
        Else&lt;br /&gt;
        Exit&lt;br /&gt;
    EndIf&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileDeleteEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIFilesConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIFiles.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_FileDeleteEx(&amp;quot;C:\Example.dat&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileDeleteEx($sFilePath)&lt;br /&gt;
    Return FileDelete($sFilePath) = 1 ? 1 : Int(_WinAPI_MoveFileEx(FileGetShortName($sFilePath), &amp;quot;&amp;quot;, $MOVE_FILE_DELAY_UNTIL_REBOOT))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileDeleteEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCheck ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the file was modified less than 24 hours ago.&lt;br /&gt;
ConsoleWrite( _FileCheck(@ScriptFullPath, 24) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileCheck($sFilePath, $iHours = 24)&lt;br /&gt;
    Local $aTime&lt;br /&gt;
    If FileExists($sFilePath) = 0 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $aTime = FileGetTime($sFilePath, 0, 0)&lt;br /&gt;
    Return Number(_DateDiff(&amp;quot;h&amp;quot;, $aTime[0] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[1] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[2] &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aTime[3] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[4] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[5], @YEAR &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MON &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MDAY &amp;amp; &amp;quot; &amp;quot; &amp;amp; @HOUR &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @MIN &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @SEC) &amp;lt; $iHours)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCheck&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCreateEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_FileCreateEx(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 42)&lt;br /&gt;
&lt;br /&gt;
; Create a blank file with a certain size in bytes.&lt;br /&gt;
Func _FileCreateEx($sFilePath, $iBytes = 0)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c fsutil file createnew &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot; &#039; &amp;amp; Int($iBytes), @WorkingDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCreateEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileID ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FileClose(FileOpen(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 2))&lt;br /&gt;
ConsoleWrite(_FileID(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;) &amp;amp; @CRLF)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;)&lt;br /&gt;
&lt;br /&gt;
; Rerieve the file id of a filepath.&lt;br /&gt;
Func _FileID($sFilePath)&lt;br /&gt;
    Local $iPID = Run(@ComSpec &amp;amp; &#039; /c fsutil file queryfileid &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot;&#039;, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD), $sReturn = &#039;&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $sReturn &amp;amp;= StdoutRead($iPID)&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return StringStripWS(StringRegExpReplace($sReturn, &#039;File\sID\sis\s(.*?)&#039;, &#039;$1&#039;), 8)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileExistsWithQuotes ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&#039;&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;&amp;quot;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&amp;quot;&#039;&amp;quot; &amp;amp; @ScriptDir &amp;amp; &amp;quot;&#039;&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Check a filepath ecists even if the path contains quotation marks.&lt;br /&gt;
Func _FileExistsWithQuotes($sFilePath)&lt;br /&gt;
    Return FileExists(StringRegExpReplace($sFilePath, &#039;^(&amp;quot;|&#039;&#039;)*([^&amp;quot;&#039;&#039;]+)(&amp;quot;|&#039;&#039;)*$&#039;, &#039;\2&#039;))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileExistsWithQuotes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== FileLineCount ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 71214-mkish&lt;br /&gt;
 | AuthorName = MKISH&lt;br /&gt;
 | Desc = Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Author - MKISH&lt;br /&gt;
&lt;br /&gt;
; Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $FILE = &amp;quot;G:\WIN7\sources\boot.wim&amp;quot;&lt;br /&gt;
Local $COUNT = 0&lt;br /&gt;
Local $start = default&lt;br /&gt;
Local $res, $fLen, $err&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
	$res = _HexSearch($FILE, StringToBinary(&amp;quot;&amp;quot; &amp;amp; @crlf), $start)&lt;br /&gt;
	$start = $res + 2&lt;br /&gt;
	$COUNT = $COUNT + 1&lt;br /&gt;
	If $res = -1 then exitloop&lt;br /&gt;
Wend&lt;br /&gt;
&lt;br /&gt;
msgbox(64, &amp;quot;&amp;quot;, &amp;quot;Lines count: &amp;quot; &amp;amp; $COUNT)&lt;br /&gt;
&lt;br /&gt;
; _HexSearch function (originally written by Zinthose, modified by MKISH)&lt;br /&gt;
Func _HexSearch($FilePath, $BinaryValue, $StartOffset = Default)&lt;br /&gt;
        Local $Buffer, $ptr, $hFile, $Result, $Read, $SearchValue, $Pos, $BufferSize = 2048&lt;br /&gt;
            If $StartOffset = Default     Then $StartOffset = 0&lt;br /&gt;
            If Not FileExists($FilePath)    Then    Return SetError(1, @error, 0)&lt;br /&gt;
            $fLen = FileGetSize($FilePath)&lt;br /&gt;
            If $StartOffset &amp;gt; $fLen   Then   Return SetError(2, @error, 0)&lt;br /&gt;
            If Not IsBinary($BinaryValue)   Then    Return SetError(3, @error, 0)&lt;br /&gt;
            If Not IsNumber($StartOffset)   Then    Return SetError(4, @error, 0)&lt;br /&gt;
            $SearchValue = BinaryToString($BinaryValue)&lt;br /&gt;
            $Buffer = DllStructCreate(&amp;quot;byte[&amp;quot; &amp;amp; $BufferSize &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
            $ptr = DllStructGetPtr($Buffer)&lt;br /&gt;
                $hFile = _WinAPI_CreateFile($FilePath, 2, 2, 1)&lt;br /&gt;
                If $hFile = 0 Then Return SetError(5, @error, 0)&lt;br /&gt;
            $Result = _WinAPI_SetFilePointer($hFile, $StartOffset)&lt;br /&gt;
            $err = @error&lt;br /&gt;
            If $Result = 0xFFFFFFFF Then&lt;br /&gt;
                _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                Return SetError(5, $err, 0)&lt;br /&gt;
            EndIf&lt;br /&gt;
            $Pos = $StartOffset&lt;br /&gt;
            While True&lt;br /&gt;
                    $Read = 0&lt;br /&gt;
                    $Result = _WinAPI_ReadFile($hFile, $ptr, $BufferSize, $Read)&lt;br /&gt;
                    $err = @error&lt;br /&gt;
                    If Not $Result Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return SetError(6, $err, 0)&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Result = DllStructGetData($Buffer, 1)&lt;br /&gt;
                    $Result = BinaryToString($Result)&lt;br /&gt;
                    $Result = StringInStr($Result, $SearchValue)&lt;br /&gt;
                    If $Result &amp;gt; 0 Then ExitLoop&lt;br /&gt;
                    If $Read &amp;lt; $BufferSize Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return -1&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Pos += $Read&lt;br /&gt;
&lt;br /&gt;
            WEnd&lt;br /&gt;
            _WinAPI_CloseHandle($hFile)&lt;br /&gt;
            If Not $Result Then Return SetError(7, @error, 0)&lt;br /&gt;
            $Result = $Pos + $Result - 1&lt;br /&gt;
            Return $Result&lt;br /&gt;
    EndFunc; ==&amp;gt; _HexSearch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sFilePath = _FileOpenDialog(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)&amp;quot;, Random(1, @DesktopWidth, 1), Random(1, @DesktopHeight, 1), 1 + 4, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&#039;File = &#039; &amp;amp; $sFilePath &amp;amp; &#039;, @error = &#039; &amp;amp; @error &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: _FileOpenDialog&lt;br /&gt;
; Description ...: Initiates a Open File Dialog with the option to set the position of the GUI.&lt;br /&gt;
; Syntax ........: _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter[, $iLeft = -1[, $iTop = -1[, $iOptions = 0[,&lt;br /&gt;
;                  $sDefaultName = &amp;quot;&amp;quot;]]]])&lt;br /&gt;
; Parameters ....: $sTitle              - Title text of the Dialog GUI.&lt;br /&gt;
;                  $sIntitialDirectory  - Initial directory selected in the GUI file tree.&lt;br /&gt;
;                  $sFilter             - File type single filter such as &amp;quot;All (*.*)&amp;quot; or &amp;quot;Text files (*.txt)&amp;quot;.&lt;br /&gt;
;                  $iLeft               - [optional] The left side of the dialog box. By default (-1), the window is centered.&lt;br /&gt;
;                  $iTop                - [optional] The top of the dialog box. Default (-1) is centered&lt;br /&gt;
;                  $iOptions            - [optional] Dialog Options: To use more than one option, add the required values together. See FileOpenDialog. Default is 0.&lt;br /&gt;
;                  $sDefaultName        - [optional] Suggested file name for the user to open. Default is blank (&amp;quot;&amp;quot;).&lt;br /&gt;
; Return values .: Success: Returns the full path of the file(s) chosen. Results for multiple selections are &amp;quot;Directory|file1|file2|...&amp;quot;&lt;br /&gt;
;                  Failure: Sets @error to non-zero.&lt;br /&gt;
; Author ........: guinness&lt;br /&gt;
; Remarks........: This doesn&#039;t change the working directory of the script like FileOpenDialog does.&lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iLeft = -1, $iTop = -1, $iOptions = 0, $sDefaultName = &amp;quot;&amp;quot;)&lt;br /&gt;
    Local $hGUI = GUICreate(&#039;&#039;, -1, -1, $iLeft, $iTop), $sWorkingDir = @WorkingDir&lt;br /&gt;
    Local $sFilePath = FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iOptions, $sDefaultName, $hGUI)&lt;br /&gt;
    Local $iError = @error&lt;br /&gt;
    FileChangeDir($sWorkingDir)&lt;br /&gt;
    Return SetError($iError, GUIDelete($hGUI), $sFilePath)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileRename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 52374-johnone&lt;br /&gt;
 | AuthorName = JohnOne&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;### Rename a file ###&lt;br /&gt;
;$sFile = Full path to file&lt;br /&gt;
;$sRename = New Filename&lt;br /&gt;
;$iOverWrite = 0 or 1&lt;br /&gt;
&lt;br /&gt;
;Success returns 1&lt;br /&gt;
;failure, returns 0 and sets @error&lt;br /&gt;
; 1 if FileMove fails, &lt;br /&gt;
; 2 if $sFile does not exist&lt;br /&gt;
;@extended&lt;br /&gt;
; 0 if the new file does not already exist / existed&lt;br /&gt;
; 1 if the new file already exists / existed&lt;br /&gt;
&lt;br /&gt;
;#### Example ####&lt;br /&gt;
$File = @ScriptDir &amp;amp; &#039;\filetorename.txt&#039;&lt;br /&gt;
FileWrite($File, &#039;Test&#039;)&lt;br /&gt;
_FileRename($File, &#039;newname.txt&#039;)&lt;br /&gt;
If @error Then MsgBox(0, &amp;quot;Error&amp;quot;, @error)&lt;br /&gt;
&lt;br /&gt;
Func _FileRename($sFile, $sRename, $iOverWrite = 0)&lt;br /&gt;
    Local Const $FILENOTEXIST = 2&lt;br /&gt;
    If Not FileExists($sFile) Then Return SetError($FILENOTEXIST, 0, 0)&lt;br /&gt;
    Local $_StringLen = StringLen($sFile)&lt;br /&gt;
    Local $_StringInStr = StringInStr($sFile, &amp;quot;\&amp;quot;, 0, -1, $_StringLen)&lt;br /&gt;
    Local $_Count = $_StringLen - $_StringInStr&lt;br /&gt;
    Local $_Dir = StringLeft($sFile, $_StringInStr)&lt;br /&gt;
    Local $_NewFile = $_Dir &amp;amp; $sRename&lt;br /&gt;
    Local $_NewFileExists = FileExists($_NewFile)&lt;br /&gt;
    Local $_FileMove = FileMove($sFile, $_NewFile, $iOverWrite)&lt;br /&gt;
    Return SetError(Not $_FileMove, $_NewFileExists, $_FileMove)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileRename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== _FileRename Alternative ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;FileRename(PathFile, RenameFile)&lt;br /&gt;
;JohnOne&lt;br /&gt;
&lt;br /&gt;
FileRename(@ScriptDir &amp;amp; &amp;quot;\rename.txt&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\renamed.txt&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func FileRename($FileName, $ReName)&lt;br /&gt;
&lt;br /&gt;
	Local $SHFILEOPSTRUCT, $SourceStruct, $DestStruct&lt;br /&gt;
	Local Const $FO_RENAME = 0x0004&lt;br /&gt;
	Local Const $FOF_SILENT = 0x0004&lt;br /&gt;
	Local Const $FOF_NOCONFIRMATION = 0x0010&lt;br /&gt;
	Local Const $FOF_NOERRORUI = 0x0400&lt;br /&gt;
	Local Const $FOF_NOCONFIRMMKDIR = 0x0200&lt;br /&gt;
	Local Const $NULL = 0&lt;br /&gt;
&lt;br /&gt;
	$SourceStruct = _StringToStruct($FileName)&lt;br /&gt;
	$DestStruct = _StringToStruct($ReName)&lt;br /&gt;
&lt;br /&gt;
	$SHFILEOPSTRUCT = DllStructCreate(&amp;quot;hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hWnd&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;wFunc&amp;quot;, $FO_RENAME)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pFrom&amp;quot;, DllStructGetPtr($SourceStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pTo&amp;quot;, DllStructGetPtr($DestStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fFlags&amp;quot;, BitOR($FOF_SILENT, $FOF_NOCONFIRMATION, $FOF_NOERRORUI, $FOF_NOCONFIRMMKDIR))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fAnyOperationsAborted&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hNameMappings&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;lpszProgressTitle&amp;quot;, $NULL)&lt;br /&gt;
&lt;br /&gt;
	$acall = DllCall(&amp;quot;shell32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;SHFileOperation&amp;quot;, &amp;quot;ptr&amp;quot;, DllStructGetPtr($SHFILEOPSTRUCT))&lt;br /&gt;
	If @error Then&lt;br /&gt;
		Return SetError(@error, @extended, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;FileRename&lt;br /&gt;
&lt;br /&gt;
Func _StringToStruct($string)&lt;br /&gt;
&lt;br /&gt;
	Local $iLen = StringLen($string)&lt;br /&gt;
	Local $Struct = DllStructCreate(&amp;quot;char[&amp;quot; &amp;amp; String($iLen + 2) &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
	DllStructSetData($Struct, 1, $string)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 1)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 2)&lt;br /&gt;
&lt;br /&gt;
	Return $Struct&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringToStruct&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Below&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath.&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $aArray = StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)&lt;br /&gt;
    Return $aArray[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Above&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath. Works with V3.3.5.4+&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsDir ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a file - &amp;quot; &amp;amp; IsDir(@ScriptFullPath) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a directory - &amp;quot; &amp;amp; IsDir(@ScriptDir) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
&lt;br /&gt;
Func IsDir($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) &amp;gt; 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsDir&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a file - &#039; &amp;amp; IsFile(@ScriptFullPath) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a directory - &#039; &amp;amp; IsFile(@ScriptDir) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
&lt;br /&gt;
Func IsFile($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) = 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsFilee&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileDiff ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return False as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return True as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is different.&lt;br /&gt;
Func _IsFileDiff($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileDiff&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileOlder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt; ; Required for _DateDiff()&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the current script is older than 10 days.&lt;br /&gt;
If _IsFileOlder(@ScriptFullPath, 10) Then&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File is older than 10 days.&#039;)&lt;br /&gt;
Else&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File isn&#039;&#039;t older than 10 days.&#039;)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
; Is a file older than a certain number of days.&lt;br /&gt;
Func _IsFileOlder($sFilePath, $iDays)&lt;br /&gt;
	Local $aArray = FileGetTime($sFilePath, $FT_CREATED)&lt;br /&gt;
	Return _DateDiff(&#039;D&#039;, $aArray[0] &amp;amp; &#039;/&#039; &amp;amp; $aArray[1] &amp;amp; &#039;/&#039; &amp;amp; $aArray[2] &amp;amp; &#039; &#039; &amp;amp; $aArray[3] &amp;amp; &#039;:&#039; &amp;amp; $aArray[4] &amp;amp; &#039;:&#039; &amp;amp; $aArray[5], @YEAR &amp;amp; &#039;/&#039; &amp;amp; @MON &amp;amp; &#039;/&#039; &amp;amp; @MDAY &amp;amp; &#039; &#039; &amp;amp; @HOUR &amp;amp; &#039;:&#039; &amp;amp; @MIN &amp;amp; &#039;:&#039; &amp;amp; @SEC) &amp;gt;= $iDays&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileOlder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileSame ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return True as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return False as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is the same.&lt;br /&gt;
Func _IsFileSame($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) = 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileSame&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__INIFileFill(@ScriptDir &amp;amp; &#039;\Example.ini&#039;) ; Create an INI file with random data.&lt;br /&gt;
&lt;br /&gt;
Local $aArray = _IniReadFile(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
_ArrayDisplay($aArray)&lt;br /&gt;
&lt;br /&gt;
Func _IniReadFile($sFilePath)&lt;br /&gt;
    Local $aReturn[1][3] = [[0, 3]], $aSectionArray, $aSectionNameArray, $iCount = 0&lt;br /&gt;
    $aSectionNameArray = IniReadSectionNames($sFilePath)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, $aReturn)&lt;br /&gt;
    EndIf&lt;br /&gt;
    For $A = 1 To $aSectionNameArray[0]&lt;br /&gt;
        $aSectionArray = IniReadSection($sFilePath, $aSectionNameArray[$A])&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ContinueLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
        For $B = 1 To $aSectionArray[0][0]&lt;br /&gt;
            $aReturn[0][0] += 1&lt;br /&gt;
            $iCount += 1&lt;br /&gt;
            If $aReturn[0][0] &amp;lt;= $iCount + 1 Then&lt;br /&gt;
                ReDim $aReturn[$aReturn[0][0] * 2][$aReturn[0][1]]&lt;br /&gt;
            EndIf&lt;br /&gt;
            $aReturn[$iCount][0] = $aSectionArray[$B][0]&lt;br /&gt;
            $aReturn[$iCount][1] = $aSectionArray[$B][1]&lt;br /&gt;
            $aReturn[$iCount][2] = $aSectionNameArray[$A]&lt;br /&gt;
        Next&lt;br /&gt;
    Next&lt;br /&gt;
    ReDim $aReturn[$aReturn[0][0] + 1][$aReturn[0][1]] ; Remove empty entries.&lt;br /&gt;
    Return $aReturn&lt;br /&gt;
EndFunc   ;==&amp;gt;_IniReadFile&lt;br /&gt;
&lt;br /&gt;
Func __INIFileFill($sFilePath)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sHeader = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    For $i = 1 To Random(1, 5, 1)&lt;br /&gt;
        $sHeader = _RandomText(Random(5, 25, 1))&lt;br /&gt;
        $sData = &amp;quot;&amp;quot;&lt;br /&gt;
        For $j = 1 To Random(1, 25, 1)&lt;br /&gt;
            $sData &amp;amp;= _RandomText(Random(5, 25, 1)) &amp;amp; &#039;=&#039; &amp;amp; _RandomText(Random(5, 25, 1)) &amp;amp; @LF&lt;br /&gt;
        Next&lt;br /&gt;
        IniWriteSection($sFilePath, $sHeader, $sData)&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc   ;==&amp;gt;__FillINIFile&lt;br /&gt;
&lt;br /&gt;
Func _RandomText($iLength = 10)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sRandom = &#039;&#039;&lt;br /&gt;
    For $i = 1 To $iLength&lt;br /&gt;
        $sRandom = Random(55, 116, 1)&lt;br /&gt;
        $sData &amp;amp;= Chr($sRandom + 6 * ($sRandom &amp;gt; 90) - 7 * ($sRandom &amp;lt; 65))&lt;br /&gt;
    Next&lt;br /&gt;
    Return $sData&lt;br /&gt;
EndFunc   ;==&amp;gt;_RandomText&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadInit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 9370-mlowery&lt;br /&gt;
 | AuthorName = mlowery&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;===============================================================================&lt;br /&gt;
; Description:     Reads values from INI or creates INI with initial values.&lt;br /&gt;
;                  Intended to ensure all available INI settings are exposed&lt;br /&gt;
;                  and editable.&lt;br /&gt;
;                  Parameters are identical to IniRead()&lt;br /&gt;
; Parameter(s):    $filename  = filename of INI&lt;br /&gt;
;                  $section  = section name of INI&lt;br /&gt;
;                  $key      = key name in section&lt;br /&gt;
;                  $default  = default value (written to INI if not exists)&lt;br /&gt;
; Requirement(s):  None&lt;br /&gt;
; Return Value(s): Returns value from INI (or default if not defined)&lt;br /&gt;
; Note(s):         Chr(127) used to detect non-existing value since won&#039;t normally exist in a text file&lt;br /&gt;
;===============================================================================&lt;br /&gt;
Func _IniReadInit($filename, $section, $key, $default)&lt;br /&gt;
  Local $value = IniRead($filename, $section, $key, Chr(127))&lt;br /&gt;
    If $value = Chr(127) Then&lt;br /&gt;
      IniWrite($filename, $section, $key, $default)&lt;br /&gt;
      $value = $default&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return $value&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsValidFileType ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;) ; By AZJIO - http://www.autoitscript.com/forum/topic/...filetype/page__view__findpost_&lt;br /&gt;
    Local $iDot = StringInStr($sFilePath, &amp;quot;.&amp;quot;, 0, -1)&lt;br /&gt;
    Return $iDot And StringInStr(&#039;;&#039; &amp;amp; $sList &amp;amp; &#039;;&#039;, &#039;;&#039; &amp;amp; StringTrimLeft($sFilePath, $iDot) &amp;amp; &#039;;&#039;) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Example 2&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;, $iOpFast = 1) ; By Yashied.&lt;br /&gt;
    If StringStripWS($sList, 8) = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $sList = &amp;quot;*&amp;quot;&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return _WinAPI_PathMatchSpec($sFilePath, StringReplace(&#039;;&#039; &amp;amp; $sList, &#039;;&#039;, &#039;;*.&#039;, 0, $iOpFast * 2))&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== File Open/Save/Folder Dialog Box ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
 | AuthorURL2 = 4997-odklizec&lt;br /&gt;
 | AuthorName2 = odklizec&lt;br /&gt;
 | AuthorURL3 = 6756-danny35d&lt;br /&gt;
 | AuthorName3 = Danny35d&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Center - File Open/Save/Folder Dialog Box&lt;br /&gt;
; Author - odklizec, MHz, Danny35d&lt;br /&gt;
&lt;br /&gt;
 If StringInStr($cmdlineraw, &#039;/MoveWin&#039;) Then&lt;br /&gt;
	 Local $size, $PosX, $PosY&lt;br /&gt;
     $cmdlineraw = StringSplit(StringMid($cmdlineraw, StringInStr($cmdlineraw, &#039;/MoveWin&#039;)), &#039;:&#039;)&lt;br /&gt;
     While 1&lt;br /&gt;
         Select&lt;br /&gt;
         Case WinExists($cmdlineraw[2])&lt;br /&gt;
             $size=WinGetPos ($cmdlineraw[2])&lt;br /&gt;
             $PosX=@DesktopWidth/2 - $size[2]/2&lt;br /&gt;
             $PosY=@DesktopHeight/2 - $size[3]/2&lt;br /&gt;
             WinMove($cmdlineraw[2], &amp;quot;&amp;quot;, $PosX, $PosY)&lt;br /&gt;
             WinActivate($cmdlineraw[2])&lt;br /&gt;
             ExitLoop&lt;br /&gt;
         EndSelect&lt;br /&gt;
         Sleep(50)&lt;br /&gt;
     WEnd&lt;br /&gt;
     Exit&lt;br /&gt;
 EndIf&lt;br /&gt;
Global $PID, $Read_File, $Save_File&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Open file Dialog Box&#039;)&lt;br /&gt;
 $Read_File = FileOpenDialog ( &amp;quot;Open file Dialog Box&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;AutoIt Files (*.au3)&amp;quot;,3,@ScriptFullPath)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Save file Dialog Box&#039;)&lt;br /&gt;
 $Save_File = FileSaveDialog( &amp;quot;Save file Dialog Box&amp;quot;, @ScriptDir, &amp;quot;Scripts (*.aut;*.au3)&amp;quot;, 3)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Browse for Folder&#039;)&lt;br /&gt;
 FileSelectFolder(&amp;quot;Choose a folder with plugins..&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;4&amp;quot;,&amp;quot;c:\&amp;quot;)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
&lt;br /&gt;
 Func _FindBrowseWin($sTitle)&lt;br /&gt;
     If @Compiled Then&lt;br /&gt;
         Return(Run(@ScriptFullPath &amp;amp; &#039; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     Else&lt;br /&gt;
         Return(Run(@AutoItExe &amp;amp; &#039; &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     EndIf&lt;br /&gt;
 EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MoveFileOnReboot ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 44525-jscript&lt;br /&gt;
 | AuthorName = JScript&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Author: JScript - Snippet Version No. = 1.0&lt;br /&gt;
;Snippet was Created Using AutoIt Version = 3.3.2.0, Creation Date = 21/03/12.&lt;br /&gt;
&lt;br /&gt;
; Function to Move or Delete a file on next reboot!&lt;br /&gt;
Func _MoveFileOnReboot($sSourcePath, $sDestPath = &amp;quot;&amp;quot;); If $sDestPath = &amp;quot;&amp;quot; the file is deleted instead of moved.&lt;br /&gt;
    Local $iRet&lt;br /&gt;
&lt;br /&gt;
    ; PendingFileRenameOperations (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager)&lt;br /&gt;
    If $DestPath = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;int&amp;quot;, 0, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    Else&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;str&amp;quot;, $sDestPath, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Return $iRet&lt;br /&gt;
EndFunc   ;==&amp;gt;_MoveFileOnReboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MultipleFileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL =&lt;br /&gt;
 | AuthorName = /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $message = &amp;quot;Hold down Ctrl or Shift to choose multiple files.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Local $filename = _MultipleFileOpenDialog($message,300,300)&lt;br /&gt;
&lt;br /&gt;
Local $var = FileOpenDialog($message, @WindowsDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)&amp;quot;, 1 + 4 )&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;No File(s) chosen&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    $var = StringReplace($var, &amp;quot;|&amp;quot;, @CRLF)&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;You chose &amp;quot; &amp;amp; $var)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
FileDelete($filename)&lt;br /&gt;
func _MultipleFileOpenDialog($title,$posx,$posy)&lt;br /&gt;
    Local $temp = EnvGet(&amp;quot;temp&amp;quot;)&lt;br /&gt;
    Local $filename = $temp &amp;amp; &amp;quot;\move_file_open_dialog.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Local $script = &#039;Global $title = &amp;quot;&#039; &amp;amp; $title &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_x = &#039; &amp;amp; $posx &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_y = &#039; &amp;amp; $posy &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;AdlibRegister(&amp;quot;_Move&amp;quot;,10)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;while 1&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;    sleep(1000)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;wend&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Func _Move()&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   if (WinActive($title)) Then&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      WinMove($title,&amp;quot;&amp;quot;,$pos_x,$pos_y)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      Exit&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   EndIf&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;EndFunc&#039; &amp;amp; @CRLF&lt;br /&gt;
&lt;br /&gt;
    FileWrite($filename,$script)&lt;br /&gt;
    ;MsgBox(0,&amp;quot;&amp;quot;,$script &amp;amp; @CRLF &amp;amp; $filename)&lt;br /&gt;
    Run(@AutoItExe &amp;amp; &amp;quot; /AutoIt3ExecuteScript &amp;quot; &amp;amp; $filename)&lt;br /&gt;
    sleep(250)&lt;br /&gt;
    Return $filename&lt;br /&gt;
EndFunc ;==&amp;gt;_MultipleFileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _OpenFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
    These have been declared in Global scope as you may wish to use them elsewhere in your script.&lt;br /&gt;
#ce&lt;br /&gt;
Global $ALTSTARTUP = 0x1d&lt;br /&gt;
Global $APPDATA = 0x1a&lt;br /&gt;
Global $BITBUCKET = 0x0a&lt;br /&gt;
Global $COMMONALTSTARTUP = 0x1e&lt;br /&gt;
Global $COMMONAPPDATA = 0x23&lt;br /&gt;
Global $COMMONDESKTOPDIR = 0x19&lt;br /&gt;
Global $COMMONFAVORITES = 0x1f&lt;br /&gt;
Global $COMMONPROGRAMS = 0x17&lt;br /&gt;
Global $COMMONSTARTMENU = 0x16&lt;br /&gt;
Global $COMMONSTARTUP = 0x18&lt;br /&gt;
Global $CONTROLS = 0x03&lt;br /&gt;
Global $COOKIES = 0x21&lt;br /&gt;
Global $DESKTOP = 0x00&lt;br /&gt;
Global $DESKTOPDIRECTORY = 0x10&lt;br /&gt;
Global $DRIVES = 0x11&lt;br /&gt;
Global $FAVORITES = 0x06&lt;br /&gt;
Global $FONTS = 0x14&lt;br /&gt;
Global $HISTORY = 0x22&lt;br /&gt;
Global $INTERNETCACHE = 0x20&lt;br /&gt;
Global $LOCALAPPDATA = 0x1c&lt;br /&gt;
Global $MYPICTURES = 0x27&lt;br /&gt;
Global $NETHOOD = 0x13&lt;br /&gt;
Global $NETWORK = 0x12&lt;br /&gt;
Global $PERSONAL = 0x05&lt;br /&gt;
Global $PRINTERS = 0x04&lt;br /&gt;
Global $PRINTHOOD = 0x1b&lt;br /&gt;
Global $PROFILE = 0x28&lt;br /&gt;
Global $PROGRAMFILES = 0x26&lt;br /&gt;
Global $PROGRAMFILESx86 = 0x30&lt;br /&gt;
Global $PROGRAMS = 0x02&lt;br /&gt;
Global $RECENT = 0x08&lt;br /&gt;
Global $SENDTO = 0x09&lt;br /&gt;
Global $STARTMENU = 0x0b&lt;br /&gt;
Global $STARTUP = 0x07&lt;br /&gt;
Global $SYSTEM = 0x25&lt;br /&gt;
Global $SYSTEMx86 = 0x29&lt;br /&gt;
Global $TEMPLATES = 0x15&lt;br /&gt;
Global $WINDOWS = 0x24&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_OpenFolder(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_OpenFolder($PRINTERS) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Open a folder or special folder variable, similar to using ShellExecute.&lt;br /&gt;
Func _OpenFolder($sFolderPath)&lt;br /&gt;
    Local $oShell = ObjCreate(&#039;shell.application&#039;)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $oShell.Open($sFolderPath)&lt;br /&gt;
    Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_OpenFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathAppendToFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sOrg = &amp;quot;C:\Some.Folder\some.file.ext&amp;quot;&lt;br /&gt;
$sAdd = &amp;quot;_backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$sNew = _PathAppendToFilename($sOrg, $sAdd)&lt;br /&gt;
&lt;br /&gt;
$sStripped = _PathStripRightFromFilename($sNew, $sAdd)&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &amp;quot;&amp;quot;, $sOrg &amp;amp; @CRLF &amp;amp; $sAdd &amp;amp; @CRLF &amp;amp; $sNew &amp;amp; @CRLF &amp;amp; $sStripped)&lt;br /&gt;
&lt;br /&gt;
Func _PathAppendToFilename($sName, $sAppend)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sAppend, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;(\.[^\\/\.]+)$&amp;quot;, $sAppend &amp;amp; &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathStripRightFromFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _PathStripRightFromFilename($sName, $sStrip)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sStrip, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;\Q&amp;quot; &amp;amp; $sStrip &amp;amp; &amp;quot;\E(\.[^\\/\.]+)$&amp;quot;, &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SelfDelete ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This also removes the directory which the file is in&lt;br /&gt;
; Author MHz with the directory delete addition by The Kandie Man&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
    Local $sCmdFile&lt;br /&gt;
    FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
    $sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039;127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;rmdir /q &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot; goto loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &#039; &amp;amp; @TempDir &amp;amp; &#039;\scratch.bat&#039;&lt;br /&gt;
    FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
    Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ShellExecuteFileSelectFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_ShellExecuteFileSelectFolder(&#039;Select a Folder&#039;, @HomeDrive) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Shell Execute a selected folder.&lt;br /&gt;
Func _ShellExecuteFileSelectFolder($sText, $sRoot, $iFlag = 0, $sInitialDir = &#039;&#039;, $hWnd = &#039;&#039;)&lt;br /&gt;
    Local $sFolder = FileSelectFolder($sText, $sRoot, $iFlag, $sInitialDir, $hWnd)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(@error, @extended, &#039;&#039;)&lt;br /&gt;
    EndIf&lt;br /&gt;
    ShellExecute($sFolder)&lt;br /&gt;
    Return $sFolder&lt;br /&gt;
EndFunc   ;==&amp;gt;_ShellExecuteFileSelectFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SuiCide ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 28010-larrydalooza&lt;br /&gt;
 | AuthorName = LarryDalooza&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION&lt;br /&gt;
; Deletes the running script&lt;br /&gt;
&lt;br /&gt;
Func SuiCide()&lt;br /&gt;
	Local $sFilePath = @TempDir &amp;amp; &#039;\SuiCide.bat&#039;&lt;br /&gt;
	FileDelete($sFilePath)&lt;br /&gt;
	FileWrite($sFilePath, &#039;loop:&#039; &amp;amp; @CRLF &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;ping -n 1 -w 250 zxywqxz_q&#039; &amp;amp; @CRLF &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; _&lt;br /&gt;
			&#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF &amp;amp; &#039;del SuiCide.bat&#039; &amp;amp; @CRLF)&lt;br /&gt;
	Exit Run($sFilePath, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;SuiCide&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _UniqueFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_UniqueFilename(@ScriptDir, &#039;.au3&#039;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _UniqueFilename($sFilePath, $sExtension)&lt;br /&gt;
    Local $iRandom = 0, $sUnqiueFileName = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $sExtension = &#039;.&#039; &amp;amp; StringRegExpReplace($sExtension, &#039;\A[\.]+&#039;, &#039;&#039;)&lt;br /&gt;
    $sFilePath = StringRegExpReplace($sFilePath, &#039;[\\/]+\z&#039;, &#039;&#039;) &amp;amp; &#039;\&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $iRandom = Random(55, 116, 1)&lt;br /&gt;
        $sUnqiueFileName &amp;amp;= Chr($iRandom + 6 * ($iRandom &amp;gt; 90) - 7 * ($iRandom &amp;lt; 65))&lt;br /&gt;
        If FileExists($sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension) = 0 And StringLen($sUnqiueFileName) &amp;gt; 7 Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return $sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension&lt;br /&gt;
EndFunc   ;==&amp;gt;_UniqueFilename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== Windows - Copy With Progress ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 19-jos&lt;br /&gt;
 | AuthorName = Jos&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Windows - Copy With Progress&lt;br /&gt;
&lt;br /&gt;
;~ 4 Do not display a progress dialog box.&lt;br /&gt;
;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.&lt;br /&gt;
;~ 16 Respond with &amp;quot;Yes to All&amp;quot; for any dialog box that is displayed.&lt;br /&gt;
;~ 64 Preserve undo information, if possible.&lt;br /&gt;
;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.&lt;br /&gt;
;~ 256 Display a progress dialog box but do not show the file names.&lt;br /&gt;
;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.&lt;br /&gt;
;~ 1024 Do not display a user interface if an error occurs.&lt;br /&gt;
;~ 2048 Version 4.71. Do not copy the security attributes of the file.&lt;br /&gt;
;~ 4096 Only operate in the local directory. Don&#039;t operate recursively into subdirectories.&lt;br /&gt;
;~ 8192 Version 5.0. Do not copy connected files as a group. Only copy the specified files.&lt;br /&gt;
&lt;br /&gt;
_FileCopy(&amp;quot;C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe&amp;quot;,&amp;quot;C:\temp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
; to copy a directory the destination directory must exist&lt;br /&gt;
&lt;br /&gt;
Func _FileCopy($fromFile,$tofile)&lt;br /&gt;
    Local $FOF_RESPOND_YES = 16&lt;br /&gt;
    Local $FOF_SIMPLEPROGRESS = 256&lt;br /&gt;
    $winShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Windows - Built In ZIP and Unzip (Windows Shell) ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
  | AuthorName = Nine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;String.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Const $sZipFile = @ScriptDir &amp;amp; &amp;quot;\Test.zip&amp;quot;&lt;br /&gt;
Const $sFolder = @ScriptDir &amp;amp; &amp;quot;\Temp&amp;quot;&lt;br /&gt;
Const $sZipNew = @ScriptDir &amp;amp; &amp;quot;\Test2.zip&amp;quot;&lt;br /&gt;
&lt;br /&gt;
DirRemove ($sFolder, $DIR_REMOVE)&lt;br /&gt;
UnZip($sZipFile, $sFolder)&lt;br /&gt;
If @error Then Exit MsgBox ($MB_SYSTEMMODAL,&amp;quot;&amp;quot;,&amp;quot;Error unzipping files : &amp;quot; &amp;amp; @error)&lt;br /&gt;
FileDelete ($sZipNew)&lt;br /&gt;
Zip ($sZipFile, $sFolder)&lt;br /&gt;
If @error Then Exit MsgBox ($MB_SYSTEMMODAL,&amp;quot;&amp;quot;,&amp;quot;Error zipping files : &amp;quot; &amp;amp; @error)&lt;br /&gt;
&lt;br /&gt;
Func UnZip($sZipFile, $sDestFolder)&lt;br /&gt;
  If Not FileExists($sZipFile) Then Return SetError (1) ; source file does not exists&lt;br /&gt;
  If Not FileExists($sDestFolder) Then&lt;br /&gt;
    If Not DirCreate($sDestFolder) Then Return SetError (2) ; unable to create destination&lt;br /&gt;
  Else&lt;br /&gt;
    If Not StringInStr(FileGetAttrib($sDestFolder), &amp;quot;D&amp;quot;) Then Return SetError (3) ; destination not folder&lt;br /&gt;
  EndIf&lt;br /&gt;
  Local $oShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
  Local $oZip = $oShell.NameSpace($sZipFile)&lt;br /&gt;
  Local $iZipFileCount = $oZip.items.Count&lt;br /&gt;
  If Not $iZipFileCount Then Return SetError (4) ; zip file empty&lt;br /&gt;
  For $oFile In $oZip.items&lt;br /&gt;
    $oShell.NameSpace($sDestFolder).copyhere($ofile)&lt;br /&gt;
  Next&lt;br /&gt;
EndFunc   ;==&amp;gt;UnZip&lt;br /&gt;
&lt;br /&gt;
Func Zip ($sZipFile, $sSourceFolder)&lt;br /&gt;
  If FileExists($sZipFile) Then Return SetError (1) ; destination file already exists&lt;br /&gt;
  If Not FileExists($sSourceFolder) Then Return SetError (2) ; source does not exist&lt;br /&gt;
  Local $hFile = FileOpen ($sZipFile, $FO_CREATEPATH+$FO_OVERWRITE+$FO_BINARY)&lt;br /&gt;
  Local Const $sString = Chr(80) &amp;amp; Chr(75) &amp;amp; Chr(5) &amp;amp; Chr(6) &amp;amp; _StringRepeat (Chr(0), 18) ; create ZIP file signature&lt;br /&gt;
  FileWrite ($hFile, $sString)&lt;br /&gt;
  FileClose($hFile)&lt;br /&gt;
  Local $oShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
  If Not $oShell.NameSpace ($sSourceFolder).items.count Then Return SetError (3) ; folder empty&lt;br /&gt;
  Local $iFiles = 0&lt;br /&gt;
  For $oFile In $oShell.NameSpace($sSourceFolder).items&lt;br /&gt;
    $oShell.NameSpace($sZipFile).copyhere($oFile)&lt;br /&gt;
    Do&lt;br /&gt;
      Sleep (100) ; let the file being copied to ZIP&lt;br /&gt;
    Until $oShell.NameSpace($sZipFile).items.count &amp;gt; $iFiles&lt;br /&gt;
    $iFiles = $oShell.NameSpace($sZipFile).items.count&lt;br /&gt;
  Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14390</id>
		<title>Snippets ( Files &amp; Folders )</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Snippets_(_Files_%26_Folders_)&amp;diff=14390"/>
		<updated>2020-08-31T09:18:09Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: Added at the end Windows - Built In Unzip (Windows Shell)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
[[category:Snippets]]&lt;br /&gt;
&lt;br /&gt;
{{Snippet Credit Header}}&lt;br /&gt;
&lt;br /&gt;
== _ConvertFileToUTF16 ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_ConvertFileToUTF16(@ScriptDir &amp;amp; &amp;quot;\Example.xml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func _ConvertFileToUTF16($sFilePath)&lt;br /&gt;
    Local $iEncoding = FileGetEncoding($sFilePath)&lt;br /&gt;
    Local $hFileOpen = FileOpen($sFilePath, $iEncoding)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $sData = FileRead($hFileOpen)&lt;br /&gt;
    FileClose($hFileOpen)&lt;br /&gt;
&lt;br /&gt;
    $hFileOpen = FileOpen($sFilePath, 2 + 32)&lt;br /&gt;
    If $hFileOpen = -1 Then&lt;br /&gt;
        Return SetError(2, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    FileWrite($hFileOpen, $sData)&lt;br /&gt;
    Return FileClose($hFileOpen)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ConvertFileToUTF16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== DropFiles ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
 | Desc = Dropping multiple files onto a GUI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Dropping multiple files onto a GUI&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global $__aDropFiles&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
	Local $hGUI = GUICreate(&#039;&#039;, 500, 500, -1, -1, -1, $WS_EX_ACCEPTFILES)&lt;br /&gt;
&lt;br /&gt;
	; Create a label that is transparent which will accept &#039;drop&#039; events.&lt;br /&gt;
	GUICtrlCreateLabel(&amp;quot;&amp;quot;, 0, 0, 500, 500)&lt;br /&gt;
	GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)&lt;br /&gt;
	GUICtrlSetResizing(-1, $GUI_DOCKALL)&lt;br /&gt;
	GUICtrlSetState(-1, $GUI_DROPACCEPTED)&lt;br /&gt;
&lt;br /&gt;
	GUIRegisterMsg($WM_DROPFILES, &amp;quot;WM_DROPFILES&amp;quot;)&lt;br /&gt;
	GUISetState(@SW_SHOW, $hGUI)&lt;br /&gt;
&lt;br /&gt;
	While 1&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
&lt;br /&gt;
			Case $GUI_EVENT_DROPPED&lt;br /&gt;
				If $__aDropFiles[0] &amp;gt; 0 Then&lt;br /&gt;
					_ArrayDisplay($__aDropFiles)&lt;br /&gt;
				EndIf&lt;br /&gt;
&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	WEnd&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&lt;br /&gt;
Func WM_DROPFILES($hWnd, $iMsg, $iwParam, $ilParam)&lt;br /&gt;
	#forceref $hWnd, $ilParam&lt;br /&gt;
	Switch $iMsg&lt;br /&gt;
		Case $WM_DROPFILES&lt;br /&gt;
			Local $aReturn = _WinAPI_DragQueryFileEx($iwParam)&lt;br /&gt;
			If IsArray($aReturn) Then&lt;br /&gt;
				$__aDropFiles = $aReturn&lt;br /&gt;
			Else&lt;br /&gt;
				Local $aError[1] = [0]&lt;br /&gt;
				$__aDropFiles = $aError&lt;br /&gt;
			EndIf&lt;br /&gt;
	EndSwitch&lt;br /&gt;
	Return $GUI_RUNDEFMSG&lt;br /&gt;
EndFunc   ;==&amp;gt;WM_DROPFILES&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ExitCheckTextChange ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 8007-negativenrg&lt;br /&gt;
 | AuthorName = NegativeNrG&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Check(when Exit), if Text is not equal to $e_to Then, prompt the user to save or not save.&lt;br /&gt;
;_ExitCheckText Change $Edit Handle, $title of messagebox, $message of messagebox, $equal to(default = NULL).&lt;br /&gt;
&lt;br /&gt;
Func _ExitCheckTextChange($E_hnd,$title,$message,$e_to = &#039;&#039;)&lt;br /&gt;
	Local $buffer, $choice, $filetosave, $handle1&lt;br /&gt;
                $buffer = GUIctrlread($E_hnd)&lt;br /&gt;
        If $buffer &amp;lt;&amp;gt; $e_to Then&lt;br /&gt;
            $choice = Msgbox(4,$title,$message)&lt;br /&gt;
            If $choice = 6 Then&lt;br /&gt;
                $filetosave = FileSaveDialog(&#039;Choose File&#039;,@scriptdir,&#039;(*.au3)&#039;)&lt;br /&gt;
                $handle1 = FileOpen($filetosave,2)&lt;br /&gt;
                FileWrite($handle1,$buffer)&lt;br /&gt;
                Exit&lt;br /&gt;
            Elseif $choice &amp;lt;&amp;gt; 6 Then&lt;br /&gt;
            Exit&lt;br /&gt;
        EndIf&lt;br /&gt;
        Else&lt;br /&gt;
        Exit&lt;br /&gt;
    EndIf&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileDeleteEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;APIFilesConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPIFiles.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_FileDeleteEx(&amp;quot;C:\Example.dat&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileDeleteEx($sFilePath)&lt;br /&gt;
    Return FileDelete($sFilePath) = 1 ? 1 : Int(_WinAPI_MoveFileEx(FileGetShortName($sFilePath), &amp;quot;&amp;quot;, $MOVE_FILE_DELAY_UNTIL_REBOOT))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileDeleteEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCheck ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the file was modified less than 24 hours ago.&lt;br /&gt;
ConsoleWrite( _FileCheck(@ScriptFullPath, 24) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _FileCheck($sFilePath, $iHours = 24)&lt;br /&gt;
    Local $aTime&lt;br /&gt;
    If FileExists($sFilePath) = 0 Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $aTime = FileGetTime($sFilePath, 0, 0)&lt;br /&gt;
    Return Number(_DateDiff(&amp;quot;h&amp;quot;, $aTime[0] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[1] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; $aTime[2] &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aTime[3] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[4] &amp;amp; &amp;quot;:&amp;quot; &amp;amp; $aTime[5], @YEAR &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MON &amp;amp; &amp;quot;/&amp;quot; &amp;amp; @MDAY &amp;amp; &amp;quot; &amp;quot; &amp;amp; @HOUR &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @MIN &amp;amp; &amp;quot;:&amp;quot; &amp;amp; @SEC) &amp;lt; $iHours)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCheck&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileCreateEx ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_FileCreateEx(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 42)&lt;br /&gt;
&lt;br /&gt;
; Create a blank file with a certain size in bytes.&lt;br /&gt;
Func _FileCreateEx($sFilePath, $iBytes = 0)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c fsutil file createnew &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot; &#039; &amp;amp; Int($iBytes), @WorkingDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileCreateEx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileID ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FileClose(FileOpen(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;, 2))&lt;br /&gt;
ConsoleWrite(_FileID(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;) &amp;amp; @CRLF)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\ExampleFile.txt&#039;)&lt;br /&gt;
&lt;br /&gt;
; Rerieve the file id of a filepath.&lt;br /&gt;
Func _FileID($sFilePath)&lt;br /&gt;
    Local $iPID = Run(@ComSpec &amp;amp; &#039; /c fsutil file queryfileid &amp;quot;&#039; &amp;amp; $sFilePath &amp;amp; &#039;&amp;quot;&#039;, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD), $sReturn = &#039;&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $sReturn &amp;amp;= StdoutRead($iPID)&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return StringStripWS(StringRegExpReplace($sReturn, &#039;File\sID\sis\s(.*?)&#039;, &#039;$1&#039;), 8)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileExistsWithQuotes ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&#039;&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;&amp;quot;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(&amp;quot;&#039;&amp;quot; &amp;amp; @ScriptDir &amp;amp; &amp;quot;&#039;&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_FileExistsWithQuotes(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Check a filepath ecists even if the path contains quotation marks.&lt;br /&gt;
Func _FileExistsWithQuotes($sFilePath)&lt;br /&gt;
    Return FileExists(StringRegExpReplace($sFilePath, &#039;^(&amp;quot;|&#039;&#039;)*([^&amp;quot;&#039;&#039;]+)(&amp;quot;|&#039;&#039;)*$&#039;, &#039;\2&#039;))&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileExistsWithQuotes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== FileLineCount ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 71214-mkish&lt;br /&gt;
 | AuthorName = MKISH&lt;br /&gt;
 | Desc = Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Author - MKISH&lt;br /&gt;
&lt;br /&gt;
; Checks the number of lines in a file (useful for larger files as well)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $FILE = &amp;quot;G:\WIN7\sources\boot.wim&amp;quot;&lt;br /&gt;
Local $COUNT = 0&lt;br /&gt;
Local $start = default&lt;br /&gt;
Local $res, $fLen, $err&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
	$res = _HexSearch($FILE, StringToBinary(&amp;quot;&amp;quot; &amp;amp; @crlf), $start)&lt;br /&gt;
	$start = $res + 2&lt;br /&gt;
	$COUNT = $COUNT + 1&lt;br /&gt;
	If $res = -1 then exitloop&lt;br /&gt;
Wend&lt;br /&gt;
&lt;br /&gt;
msgbox(64, &amp;quot;&amp;quot;, &amp;quot;Lines count: &amp;quot; &amp;amp; $COUNT)&lt;br /&gt;
&lt;br /&gt;
; _HexSearch function (originally written by Zinthose, modified by MKISH)&lt;br /&gt;
Func _HexSearch($FilePath, $BinaryValue, $StartOffset = Default)&lt;br /&gt;
        Local $Buffer, $ptr, $hFile, $Result, $Read, $SearchValue, $Pos, $BufferSize = 2048&lt;br /&gt;
            If $StartOffset = Default     Then $StartOffset = 0&lt;br /&gt;
            If Not FileExists($FilePath)    Then    Return SetError(1, @error, 0)&lt;br /&gt;
            $fLen = FileGetSize($FilePath)&lt;br /&gt;
            If $StartOffset &amp;gt; $fLen   Then   Return SetError(2, @error, 0)&lt;br /&gt;
            If Not IsBinary($BinaryValue)   Then    Return SetError(3, @error, 0)&lt;br /&gt;
            If Not IsNumber($StartOffset)   Then    Return SetError(4, @error, 0)&lt;br /&gt;
            $SearchValue = BinaryToString($BinaryValue)&lt;br /&gt;
            $Buffer = DllStructCreate(&amp;quot;byte[&amp;quot; &amp;amp; $BufferSize &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
            $ptr = DllStructGetPtr($Buffer)&lt;br /&gt;
                $hFile = _WinAPI_CreateFile($FilePath, 2, 2, 1)&lt;br /&gt;
                If $hFile = 0 Then Return SetError(5, @error, 0)&lt;br /&gt;
            $Result = _WinAPI_SetFilePointer($hFile, $StartOffset)&lt;br /&gt;
            $err = @error&lt;br /&gt;
            If $Result = 0xFFFFFFFF Then&lt;br /&gt;
                _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                Return SetError(5, $err, 0)&lt;br /&gt;
            EndIf&lt;br /&gt;
            $Pos = $StartOffset&lt;br /&gt;
            While True&lt;br /&gt;
                    $Read = 0&lt;br /&gt;
                    $Result = _WinAPI_ReadFile($hFile, $ptr, $BufferSize, $Read)&lt;br /&gt;
                    $err = @error&lt;br /&gt;
                    If Not $Result Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return SetError(6, $err, 0)&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Result = DllStructGetData($Buffer, 1)&lt;br /&gt;
                    $Result = BinaryToString($Result)&lt;br /&gt;
                    $Result = StringInStr($Result, $SearchValue)&lt;br /&gt;
                    If $Result &amp;gt; 0 Then ExitLoop&lt;br /&gt;
                    If $Read &amp;lt; $BufferSize Then&lt;br /&gt;
                        _WinAPI_CloseHandle($hFile)&lt;br /&gt;
                        Return -1&lt;br /&gt;
                    EndIf&lt;br /&gt;
                    $Pos += $Read&lt;br /&gt;
&lt;br /&gt;
            WEnd&lt;br /&gt;
            _WinAPI_CloseHandle($hFile)&lt;br /&gt;
            If Not $Result Then Return SetError(7, @error, 0)&lt;br /&gt;
            $Result = $Pos + $Result - 1&lt;br /&gt;
            Return $Result&lt;br /&gt;
    EndFunc; ==&amp;gt; _HexSearch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sFilePath = _FileOpenDialog(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)&amp;quot;, Random(1, @DesktopWidth, 1), Random(1, @DesktopHeight, 1), 1 + 4, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&#039;File = &#039; &amp;amp; $sFilePath &amp;amp; &#039;, @error = &#039; &amp;amp; @error &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: _FileOpenDialog&lt;br /&gt;
; Description ...: Initiates a Open File Dialog with the option to set the position of the GUI.&lt;br /&gt;
; Syntax ........: _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter[, $iLeft = -1[, $iTop = -1[, $iOptions = 0[,&lt;br /&gt;
;                  $sDefaultName = &amp;quot;&amp;quot;]]]])&lt;br /&gt;
; Parameters ....: $sTitle              - Title text of the Dialog GUI.&lt;br /&gt;
;                  $sIntitialDirectory  - Initial directory selected in the GUI file tree.&lt;br /&gt;
;                  $sFilter             - File type single filter such as &amp;quot;All (*.*)&amp;quot; or &amp;quot;Text files (*.txt)&amp;quot;.&lt;br /&gt;
;                  $iLeft               - [optional] The left side of the dialog box. By default (-1), the window is centered.&lt;br /&gt;
;                  $iTop                - [optional] The top of the dialog box. Default (-1) is centered&lt;br /&gt;
;                  $iOptions            - [optional] Dialog Options: To use more than one option, add the required values together. See FileOpenDialog. Default is 0.&lt;br /&gt;
;                  $sDefaultName        - [optional] Suggested file name for the user to open. Default is blank (&amp;quot;&amp;quot;).&lt;br /&gt;
; Return values .: Success: Returns the full path of the file(s) chosen. Results for multiple selections are &amp;quot;Directory|file1|file2|...&amp;quot;&lt;br /&gt;
;                  Failure: Sets @error to non-zero.&lt;br /&gt;
; Author ........: guinness&lt;br /&gt;
; Remarks........: This doesn&#039;t change the working directory of the script like FileOpenDialog does.&lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func _FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iLeft = -1, $iTop = -1, $iOptions = 0, $sDefaultName = &amp;quot;&amp;quot;)&lt;br /&gt;
    Local $hGUI = GUICreate(&#039;&#039;, -1, -1, $iLeft, $iTop), $sWorkingDir = @WorkingDir&lt;br /&gt;
    Local $sFilePath = FileOpenDialog($sTitle, $sIntitialDirectory, $sFilter, $iOptions, $sDefaultName, $hGUI)&lt;br /&gt;
    Local $iError = @error&lt;br /&gt;
    FileChangeDir($sWorkingDir)&lt;br /&gt;
    Return SetError($iError, GUIDelete($hGUI), $sFilePath)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _FileRename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 52374-johnone&lt;br /&gt;
 | AuthorName = JohnOne&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;### Rename a file ###&lt;br /&gt;
;$sFile = Full path to file&lt;br /&gt;
;$sRename = New Filename&lt;br /&gt;
;$iOverWrite = 0 or 1&lt;br /&gt;
&lt;br /&gt;
;Success returns 1&lt;br /&gt;
;failure, returns 0 and sets @error&lt;br /&gt;
; 1 if FileMove fails, &lt;br /&gt;
; 2 if $sFile does not exist&lt;br /&gt;
;@extended&lt;br /&gt;
; 0 if the new file does not already exist / existed&lt;br /&gt;
; 1 if the new file already exists / existed&lt;br /&gt;
&lt;br /&gt;
;#### Example ####&lt;br /&gt;
$File = @ScriptDir &amp;amp; &#039;\filetorename.txt&#039;&lt;br /&gt;
FileWrite($File, &#039;Test&#039;)&lt;br /&gt;
_FileRename($File, &#039;newname.txt&#039;)&lt;br /&gt;
If @error Then MsgBox(0, &amp;quot;Error&amp;quot;, @error)&lt;br /&gt;
&lt;br /&gt;
Func _FileRename($sFile, $sRename, $iOverWrite = 0)&lt;br /&gt;
    Local Const $FILENOTEXIST = 2&lt;br /&gt;
    If Not FileExists($sFile) Then Return SetError($FILENOTEXIST, 0, 0)&lt;br /&gt;
    Local $_StringLen = StringLen($sFile)&lt;br /&gt;
    Local $_StringInStr = StringInStr($sFile, &amp;quot;\&amp;quot;, 0, -1, $_StringLen)&lt;br /&gt;
    Local $_Count = $_StringLen - $_StringInStr&lt;br /&gt;
    Local $_Dir = StringLeft($sFile, $_StringInStr)&lt;br /&gt;
    Local $_NewFile = $_Dir &amp;amp; $sRename&lt;br /&gt;
    Local $_NewFileExists = FileExists($_NewFile)&lt;br /&gt;
    Local $_FileMove = FileMove($sFile, $_NewFile, $iOverWrite)&lt;br /&gt;
    Return SetError(Not $_FileMove, $_NewFileExists, $_FileMove)&lt;br /&gt;
EndFunc   ;==&amp;gt;_FileRename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== _FileRename Alternative ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;FileRename(PathFile, RenameFile)&lt;br /&gt;
;JohnOne&lt;br /&gt;
&lt;br /&gt;
FileRename(@ScriptDir &amp;amp; &amp;quot;\rename.txt&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\renamed.txt&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Func FileRename($FileName, $ReName)&lt;br /&gt;
&lt;br /&gt;
	Local $SHFILEOPSTRUCT, $SourceStruct, $DestStruct&lt;br /&gt;
	Local Const $FO_RENAME = 0x0004&lt;br /&gt;
	Local Const $FOF_SILENT = 0x0004&lt;br /&gt;
	Local Const $FOF_NOCONFIRMATION = 0x0010&lt;br /&gt;
	Local Const $FOF_NOERRORUI = 0x0400&lt;br /&gt;
	Local Const $FOF_NOCONFIRMMKDIR = 0x0200&lt;br /&gt;
	Local Const $NULL = 0&lt;br /&gt;
&lt;br /&gt;
	$SourceStruct = _StringToStruct($FileName)&lt;br /&gt;
	$DestStruct = _StringToStruct($ReName)&lt;br /&gt;
&lt;br /&gt;
	$SHFILEOPSTRUCT = DllStructCreate(&amp;quot;hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hWnd&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;wFunc&amp;quot;, $FO_RENAME)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pFrom&amp;quot;, DllStructGetPtr($SourceStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;pTo&amp;quot;, DllStructGetPtr($DestStruct))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fFlags&amp;quot;, BitOR($FOF_SILENT, $FOF_NOCONFIRMATION, $FOF_NOERRORUI, $FOF_NOCONFIRMMKDIR))&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;fAnyOperationsAborted&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;hNameMappings&amp;quot;, $NULL)&lt;br /&gt;
	DllStructSetData($SHFILEOPSTRUCT, &amp;quot;lpszProgressTitle&amp;quot;, $NULL)&lt;br /&gt;
&lt;br /&gt;
	$acall = DllCall(&amp;quot;shell32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;SHFileOperation&amp;quot;, &amp;quot;ptr&amp;quot;, DllStructGetPtr($SHFILEOPSTRUCT))&lt;br /&gt;
	If @error Then&lt;br /&gt;
		Return SetError(@error, @extended, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;FileRename&lt;br /&gt;
&lt;br /&gt;
Func _StringToStruct($string)&lt;br /&gt;
&lt;br /&gt;
	Local $iLen = StringLen($string)&lt;br /&gt;
	Local $Struct = DllStructCreate(&amp;quot;char[&amp;quot; &amp;amp; String($iLen + 2) &amp;amp; &amp;quot;]&amp;quot;)&lt;br /&gt;
	DllStructSetData($Struct, 1, $string)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 1)&lt;br /&gt;
	DllStructSetData($Struct, 1, 0, $iLen + 2)&lt;br /&gt;
&lt;br /&gt;
	Return $Struct&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringToStruct&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Below&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath.&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Local $aArray = StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)&lt;br /&gt;
    Return $aArray[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _GetFolderDepth ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Autoit 3.3.5.4 and Above&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir &amp;amp; &#039;&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_GetFolderDepth(@ScriptFullPath) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Get the folder depth of a filepath. Works with V3.3.5.4+&lt;br /&gt;
Func _GetFolderDepth($sFilePath)&lt;br /&gt;
    If StringInStr($sFilePath, &#039;.&#039;, 2, -1) Then&lt;br /&gt;
        $sFilePath = StringLeft($sFilePath, StringInStr($sFilePath, &amp;quot;&amp;quot;, 2, -1) - 1)&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return StringSplit(StringRegExpReplace($sFilePath, &#039;[/]+z&#039;, &#039;&#039;), &#039;&#039;)[0] - 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetFolderDepth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsDir ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a file - &amp;quot; &amp;amp; IsDir(@ScriptFullPath) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
ConsoleWrite(&amp;quot;IsDir: Using a directory - &amp;quot; &amp;amp; IsDir(@ScriptDir) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
&lt;br /&gt;
Func IsDir($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) &amp;gt; 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsDir&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a file - &#039; &amp;amp; IsFile(@ScriptFullPath) &amp;amp; @CRLF) ; Return 1&lt;br /&gt;
ConsoleWrite(&#039;IsFile: Using a directory - &#039; &amp;amp; IsFile(@ScriptDir) &amp;amp; @CRLF) ; Return 0&lt;br /&gt;
&lt;br /&gt;
Func IsFile($sFilePath)&lt;br /&gt;
	Return Int(FileExists($sFilePath) And StringInStr(FileGetAttrib($sFilePath), &#039;D&#039;, Default, 1) = 0)&lt;br /&gt;
EndFunc   ;==&amp;gt;IsFilee&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileDiff ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return False as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileDiff(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return True as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is different.&lt;br /&gt;
Func _IsFileDiff($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileDiff&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileOlder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Date.au3&amp;gt; ; Required for _DateDiff()&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Check if the current script is older than 10 days.&lt;br /&gt;
If _IsFileOlder(@ScriptFullPath, 10) Then&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File is older than 10 days.&#039;)&lt;br /&gt;
Else&lt;br /&gt;
	MsgBox($MB_SYSTEMMODAL, &#039;&#039;, &#039;File isn&#039;&#039;t older than 10 days.&#039;)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
; Is a file older than a certain number of days.&lt;br /&gt;
Func _IsFileOlder($sFilePath, $iDays)&lt;br /&gt;
	Local $aArray = FileGetTime($sFilePath, $FT_CREATED)&lt;br /&gt;
	Return _DateDiff(&#039;D&#039;, $aArray[0] &amp;amp; &#039;/&#039; &amp;amp; $aArray[1] &amp;amp; &#039;/&#039; &amp;amp; $aArray[2] &amp;amp; &#039; &#039; &amp;amp; $aArray[3] &amp;amp; &#039;:&#039; &amp;amp; $aArray[4] &amp;amp; &#039;:&#039; &amp;amp; $aArray[5], @YEAR &amp;amp; &#039;/&#039; &amp;amp; @MON &amp;amp; &#039;/&#039; &amp;amp; @MDAY &amp;amp; &#039; &#039; &amp;amp; @HOUR &amp;amp; &#039;:&#039; &amp;amp; @MIN &amp;amp; &#039;:&#039; &amp;amp; @SEC) &amp;gt;= $iDays&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileOlder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsFileSame ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @ScriptFullPath) &amp;amp; @CRLF) ; This will return True as the files are exactly the same.&lt;br /&gt;
ConsoleWrite(_IsFileSame(@ScriptFullPath, @AutoItExe) &amp;amp; @CRLF) ; This will return False as the files are different.&lt;br /&gt;
&lt;br /&gt;
; Check if a file is the same.&lt;br /&gt;
Func _IsFileSame($sFilePath_1, $sFilePath_2)&lt;br /&gt;
    Return RunWait(@ComSpec &amp;amp; &#039; /c FC /B /W &amp;quot;&#039; &amp;amp; $sFilePath_1 &amp;amp; &#039;&amp;quot; &amp;quot;&#039; &amp;amp; $sFilePath_2 &amp;amp; &#039;&amp;quot;&#039;, @WorkingDir, @SW_HIDE) = 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsFileSame&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadFile ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__INIFileFill(@ScriptDir &amp;amp; &#039;\Example.ini&#039;) ; Create an INI file with random data.&lt;br /&gt;
&lt;br /&gt;
Local $aArray = _IniReadFile(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
FileDelete(@ScriptDir &amp;amp; &#039;\Example.ini&#039;)&lt;br /&gt;
_ArrayDisplay($aArray)&lt;br /&gt;
&lt;br /&gt;
Func _IniReadFile($sFilePath)&lt;br /&gt;
    Local $aReturn[1][3] = [[0, 3]], $aSectionArray, $aSectionNameArray, $iCount = 0&lt;br /&gt;
    $aSectionNameArray = IniReadSectionNames($sFilePath)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, $aReturn)&lt;br /&gt;
    EndIf&lt;br /&gt;
    For $A = 1 To $aSectionNameArray[0]&lt;br /&gt;
        $aSectionArray = IniReadSection($sFilePath, $aSectionNameArray[$A])&lt;br /&gt;
        If @error Then&lt;br /&gt;
            ContinueLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
        For $B = 1 To $aSectionArray[0][0]&lt;br /&gt;
            $aReturn[0][0] += 1&lt;br /&gt;
            $iCount += 1&lt;br /&gt;
            If $aReturn[0][0] &amp;lt;= $iCount + 1 Then&lt;br /&gt;
                ReDim $aReturn[$aReturn[0][0] * 2][$aReturn[0][1]]&lt;br /&gt;
            EndIf&lt;br /&gt;
            $aReturn[$iCount][0] = $aSectionArray[$B][0]&lt;br /&gt;
            $aReturn[$iCount][1] = $aSectionArray[$B][1]&lt;br /&gt;
            $aReturn[$iCount][2] = $aSectionNameArray[$A]&lt;br /&gt;
        Next&lt;br /&gt;
    Next&lt;br /&gt;
    ReDim $aReturn[$aReturn[0][0] + 1][$aReturn[0][1]] ; Remove empty entries.&lt;br /&gt;
    Return $aReturn&lt;br /&gt;
EndFunc   ;==&amp;gt;_IniReadFile&lt;br /&gt;
&lt;br /&gt;
Func __INIFileFill($sFilePath)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sHeader = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    For $i = 1 To Random(1, 5, 1)&lt;br /&gt;
        $sHeader = _RandomText(Random(5, 25, 1))&lt;br /&gt;
        $sData = &amp;quot;&amp;quot;&lt;br /&gt;
        For $j = 1 To Random(1, 25, 1)&lt;br /&gt;
            $sData &amp;amp;= _RandomText(Random(5, 25, 1)) &amp;amp; &#039;=&#039; &amp;amp; _RandomText(Random(5, 25, 1)) &amp;amp; @LF&lt;br /&gt;
        Next&lt;br /&gt;
        IniWriteSection($sFilePath, $sHeader, $sData)&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc   ;==&amp;gt;__FillINIFile&lt;br /&gt;
&lt;br /&gt;
Func _RandomText($iLength = 10)&lt;br /&gt;
    Local $sData = &#039;&#039;, $sRandom = &#039;&#039;&lt;br /&gt;
    For $i = 1 To $iLength&lt;br /&gt;
        $sRandom = Random(55, 116, 1)&lt;br /&gt;
        $sData &amp;amp;= Chr($sRandom + 6 * ($sRandom &amp;gt; 90) - 7 * ($sRandom &amp;lt; 65))&lt;br /&gt;
    Next&lt;br /&gt;
    Return $sData&lt;br /&gt;
EndFunc   ;==&amp;gt;_RandomText&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IniReadInit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 9370-mlowery&lt;br /&gt;
 | AuthorName = mlowery&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;===============================================================================&lt;br /&gt;
; Description:     Reads values from INI or creates INI with initial values.&lt;br /&gt;
;                  Intended to ensure all available INI settings are exposed&lt;br /&gt;
;                  and editable.&lt;br /&gt;
;                  Parameters are identical to IniRead()&lt;br /&gt;
; Parameter(s):    $filename  = filename of INI&lt;br /&gt;
;                  $section  = section name of INI&lt;br /&gt;
;                  $key      = key name in section&lt;br /&gt;
;                  $default  = default value (written to INI if not exists)&lt;br /&gt;
; Requirement(s):  None&lt;br /&gt;
; Return Value(s): Returns value from INI (or default if not defined)&lt;br /&gt;
; Note(s):         Chr(127) used to detect non-existing value since won&#039;t normally exist in a text file&lt;br /&gt;
;===============================================================================&lt;br /&gt;
Func _IniReadInit($filename, $section, $key, $default)&lt;br /&gt;
  Local $value = IniRead($filename, $section, $key, Chr(127))&lt;br /&gt;
    If $value = Chr(127) Then&lt;br /&gt;
      IniWrite($filename, $section, $key, $default)&lt;br /&gt;
      $value = $default&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return $value&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _IsValidFileType ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;) ; By AZJIO - http://www.autoitscript.com/forum/topic/...filetype/page__view__findpost_&lt;br /&gt;
    Local $iDot = StringInStr($sFilePath, &amp;quot;.&amp;quot;, 0, -1)&lt;br /&gt;
    Return $iDot And StringInStr(&#039;;&#039; &amp;amp; $sList &amp;amp; &#039;;&#039;, &#039;;&#039; &amp;amp; StringTrimLeft($sFilePath, $iDot) &amp;amp; &#039;;&#039;) &amp;gt; 0&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Example 2&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;WinAPIEx.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@ScriptFullPath &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@ScriptFullPath, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(@AutoItExe &amp;amp; &amp;quot; &amp;gt;&amp;gt; &amp;quot; &amp;amp; _IsValidFileType(@AutoItExe, &amp;quot;bat;cmd;au3&amp;quot;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Check if a filepath matches an extension filetype. Based on the idea by guinness - http://www.autoitscript.com/forum/topic/123674-isvalidfiletype/&lt;br /&gt;
Func _IsValidFileType($sFilePath, $sList = &amp;quot;bat;cmd;exe&amp;quot;, $iOpFast = 1) ; By Yashied.&lt;br /&gt;
    If StringStripWS($sList, 8) = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $sList = &amp;quot;*&amp;quot;&lt;br /&gt;
    EndIf&lt;br /&gt;
    Return _WinAPI_PathMatchSpec($sFilePath, StringReplace(&#039;;&#039; &amp;amp; $sList, &#039;;&#039;, &#039;;*.&#039;, 0, $iOpFast * 2))&lt;br /&gt;
EndFunc   ;==&amp;gt;_IsValidFileType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== File Open/Save/Folder Dialog Box ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
 | AuthorURL2 = 4997-odklizec&lt;br /&gt;
 | AuthorName2 = odklizec&lt;br /&gt;
 | AuthorURL3 = 6756-danny35d&lt;br /&gt;
 | AuthorName3 = Danny35d&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Center - File Open/Save/Folder Dialog Box&lt;br /&gt;
; Author - odklizec, MHz, Danny35d&lt;br /&gt;
&lt;br /&gt;
 If StringInStr($cmdlineraw, &#039;/MoveWin&#039;) Then&lt;br /&gt;
	 Local $size, $PosX, $PosY&lt;br /&gt;
     $cmdlineraw = StringSplit(StringMid($cmdlineraw, StringInStr($cmdlineraw, &#039;/MoveWin&#039;)), &#039;:&#039;)&lt;br /&gt;
     While 1&lt;br /&gt;
         Select&lt;br /&gt;
         Case WinExists($cmdlineraw[2])&lt;br /&gt;
             $size=WinGetPos ($cmdlineraw[2])&lt;br /&gt;
             $PosX=@DesktopWidth/2 - $size[2]/2&lt;br /&gt;
             $PosY=@DesktopHeight/2 - $size[3]/2&lt;br /&gt;
             WinMove($cmdlineraw[2], &amp;quot;&amp;quot;, $PosX, $PosY)&lt;br /&gt;
             WinActivate($cmdlineraw[2])&lt;br /&gt;
             ExitLoop&lt;br /&gt;
         EndSelect&lt;br /&gt;
         Sleep(50)&lt;br /&gt;
     WEnd&lt;br /&gt;
     Exit&lt;br /&gt;
 EndIf&lt;br /&gt;
Global $PID, $Read_File, $Save_File&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Open file Dialog Box&#039;)&lt;br /&gt;
 $Read_File = FileOpenDialog ( &amp;quot;Open file Dialog Box&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;AutoIt Files (*.au3)&amp;quot;,3,@ScriptFullPath)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Save file Dialog Box&#039;)&lt;br /&gt;
 $Save_File = FileSaveDialog( &amp;quot;Save file Dialog Box&amp;quot;, @ScriptDir, &amp;quot;Scripts (*.aut;*.au3)&amp;quot;, 3)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
 $PID = _FindBrowseWin(&#039;Browse for Folder&#039;)&lt;br /&gt;
 FileSelectFolder(&amp;quot;Choose a folder with plugins..&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;4&amp;quot;,&amp;quot;c:\&amp;quot;)&lt;br /&gt;
 ProcessClose($PID)&lt;br /&gt;
&lt;br /&gt;
 Func _FindBrowseWin($sTitle)&lt;br /&gt;
     If @Compiled Then&lt;br /&gt;
         Return(Run(@ScriptFullPath &amp;amp; &#039; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     Else&lt;br /&gt;
         Return(Run(@AutoItExe &amp;amp; &#039; &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; /MoveWin:&#039; &amp;amp; $sTitle))&lt;br /&gt;
     EndIf&lt;br /&gt;
 EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MoveFileOnReboot ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 44525-jscript&lt;br /&gt;
 | AuthorName = JScript&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
;Author: JScript - Snippet Version No. = 1.0&lt;br /&gt;
;Snippet was Created Using AutoIt Version = 3.3.2.0, Creation Date = 21/03/12.&lt;br /&gt;
&lt;br /&gt;
; Function to Move or Delete a file on next reboot!&lt;br /&gt;
Func _MoveFileOnReboot($sSourcePath, $sDestPath = &amp;quot;&amp;quot;); If $sDestPath = &amp;quot;&amp;quot; the file is deleted instead of moved.&lt;br /&gt;
    Local $iRet&lt;br /&gt;
&lt;br /&gt;
    ; PendingFileRenameOperations (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager)&lt;br /&gt;
    If $DestPath = &amp;quot;&amp;quot; Then&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;int&amp;quot;, 0, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    Else&lt;br /&gt;
        $iRet = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;MoveFileExA&amp;quot;, &amp;quot;str&amp;quot;, $sSourcePath, &amp;quot;str&amp;quot;, $sDestPath, &amp;quot;dword&amp;quot;, 4)&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Return $iRet&lt;br /&gt;
EndFunc   ;==&amp;gt;_MoveFileOnReboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _MultipleFileOpenDialog ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL =&lt;br /&gt;
 | AuthorName = /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $message = &amp;quot;Hold down Ctrl or Shift to choose multiple files.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Local $filename = _MultipleFileOpenDialog($message,300,300)&lt;br /&gt;
&lt;br /&gt;
Local $var = FileOpenDialog($message, @WindowsDir &amp;amp; &amp;quot;\&amp;quot;, &amp;quot;Images (*.jpg;*.bmp)&amp;quot;, 1 + 4 )&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;No File(s) chosen&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    $var = StringReplace($var, &amp;quot;|&amp;quot;, @CRLF)&lt;br /&gt;
    MsgBox(4096,&amp;quot;&amp;quot;,&amp;quot;You chose &amp;quot; &amp;amp; $var)&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
FileDelete($filename)&lt;br /&gt;
func _MultipleFileOpenDialog($title,$posx,$posy)&lt;br /&gt;
    Local $temp = EnvGet(&amp;quot;temp&amp;quot;)&lt;br /&gt;
    Local $filename = $temp &amp;amp; &amp;quot;\move_file_open_dialog.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Local $script = &#039;Global $title = &amp;quot;&#039; &amp;amp; $title &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_x = &#039; &amp;amp; $posx &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Global $pos_y = &#039; &amp;amp; $posy &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;AdlibRegister(&amp;quot;_Move&amp;quot;,10)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;while 1&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;    sleep(1000)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;wend&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;Func _Move()&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   if (WinActive($title)) Then&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      WinMove($title,&amp;quot;&amp;quot;,$pos_x,$pos_y)&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;      Exit&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;   EndIf&#039; &amp;amp; @CRLF&lt;br /&gt;
    $script &amp;amp;= &#039;EndFunc&#039; &amp;amp; @CRLF&lt;br /&gt;
&lt;br /&gt;
    FileWrite($filename,$script)&lt;br /&gt;
    ;MsgBox(0,&amp;quot;&amp;quot;,$script &amp;amp; @CRLF &amp;amp; $filename)&lt;br /&gt;
    Run(@AutoItExe &amp;amp; &amp;quot; /AutoIt3ExecuteScript &amp;quot; &amp;amp; $filename)&lt;br /&gt;
    sleep(250)&lt;br /&gt;
    Return $filename&lt;br /&gt;
EndFunc ;==&amp;gt;_MultipleFileOpenDialog()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _OpenFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
    These have been declared in Global scope as you may wish to use them elsewhere in your script.&lt;br /&gt;
#ce&lt;br /&gt;
Global $ALTSTARTUP = 0x1d&lt;br /&gt;
Global $APPDATA = 0x1a&lt;br /&gt;
Global $BITBUCKET = 0x0a&lt;br /&gt;
Global $COMMONALTSTARTUP = 0x1e&lt;br /&gt;
Global $COMMONAPPDATA = 0x23&lt;br /&gt;
Global $COMMONDESKTOPDIR = 0x19&lt;br /&gt;
Global $COMMONFAVORITES = 0x1f&lt;br /&gt;
Global $COMMONPROGRAMS = 0x17&lt;br /&gt;
Global $COMMONSTARTMENU = 0x16&lt;br /&gt;
Global $COMMONSTARTUP = 0x18&lt;br /&gt;
Global $CONTROLS = 0x03&lt;br /&gt;
Global $COOKIES = 0x21&lt;br /&gt;
Global $DESKTOP = 0x00&lt;br /&gt;
Global $DESKTOPDIRECTORY = 0x10&lt;br /&gt;
Global $DRIVES = 0x11&lt;br /&gt;
Global $FAVORITES = 0x06&lt;br /&gt;
Global $FONTS = 0x14&lt;br /&gt;
Global $HISTORY = 0x22&lt;br /&gt;
Global $INTERNETCACHE = 0x20&lt;br /&gt;
Global $LOCALAPPDATA = 0x1c&lt;br /&gt;
Global $MYPICTURES = 0x27&lt;br /&gt;
Global $NETHOOD = 0x13&lt;br /&gt;
Global $NETWORK = 0x12&lt;br /&gt;
Global $PERSONAL = 0x05&lt;br /&gt;
Global $PRINTERS = 0x04&lt;br /&gt;
Global $PRINTHOOD = 0x1b&lt;br /&gt;
Global $PROFILE = 0x28&lt;br /&gt;
Global $PROGRAMFILES = 0x26&lt;br /&gt;
Global $PROGRAMFILESx86 = 0x30&lt;br /&gt;
Global $PROGRAMS = 0x02&lt;br /&gt;
Global $RECENT = 0x08&lt;br /&gt;
Global $SENDTO = 0x09&lt;br /&gt;
Global $STARTMENU = 0x0b&lt;br /&gt;
Global $STARTUP = 0x07&lt;br /&gt;
Global $SYSTEM = 0x25&lt;br /&gt;
Global $SYSTEMx86 = 0x29&lt;br /&gt;
Global $TEMPLATES = 0x15&lt;br /&gt;
Global $WINDOWS = 0x24&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_OpenFolder(@ScriptDir) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(_OpenFolder($PRINTERS) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Open a folder or special folder variable, similar to using ShellExecute.&lt;br /&gt;
Func _OpenFolder($sFolderPath)&lt;br /&gt;
    Local $oShell = ObjCreate(&#039;shell.application&#039;)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(1, 0, 0)&lt;br /&gt;
    EndIf&lt;br /&gt;
    $oShell.Open($sFolderPath)&lt;br /&gt;
    Return 1&lt;br /&gt;
EndFunc   ;==&amp;gt;_OpenFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathAppendToFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sOrg = &amp;quot;C:\Some.Folder\some.file.ext&amp;quot;&lt;br /&gt;
$sAdd = &amp;quot;_backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$sNew = _PathAppendToFilename($sOrg, $sAdd)&lt;br /&gt;
&lt;br /&gt;
$sStripped = _PathStripRightFromFilename($sNew, $sAdd)&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &amp;quot;&amp;quot;, $sOrg &amp;amp; @CRLF &amp;amp; $sAdd &amp;amp; @CRLF &amp;amp; $sNew &amp;amp; @CRLF &amp;amp; $sStripped)&lt;br /&gt;
&lt;br /&gt;
Func _PathAppendToFilename($sName, $sAppend)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sAppend, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;(\.[^\\/\.]+)$&amp;quot;, $sAppend &amp;amp; &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _PathStripRightFromFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 31965-progandy&lt;br /&gt;
 | AuthorName = ProgAndy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _PathStripRightFromFilename($sName, $sStrip)&lt;br /&gt;
    ; Author: ProgAndy&lt;br /&gt;
    If StringRegExp($sStrip, &#039;[\/\\:\?&amp;quot;&amp;lt;&amp;gt;\|\*]&#039;) Then Return SetError(1, 0, $sName)&lt;br /&gt;
    Return StringRegExpReplace($sName, &amp;quot;\Q&amp;quot; &amp;amp; $sStrip &amp;amp; &amp;quot;\E(\.[^\\/\.]+)$&amp;quot;, &amp;quot;\1&amp;quot;, 1)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SelfDelete ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 2709-mhz&lt;br /&gt;
 | AuthorName = MHz&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; This also removes the directory which the file is in&lt;br /&gt;
; Author MHz with the directory delete addition by The Kandie Man&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
    Local $sCmdFile&lt;br /&gt;
    FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
    $sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039;127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;:loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;rmdir /q &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; $dirToDelete &amp;amp; &#039;&amp;quot; goto loop2&#039; &amp;amp; @CRLF _&lt;br /&gt;
            &amp;amp; &#039;del &#039; &amp;amp; @TempDir &amp;amp; &#039;\scratch.bat&#039;&lt;br /&gt;
    FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
    Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _ShellExecuteFileSelectFolder ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_ShellExecuteFileSelectFolder(&#039;Select a Folder&#039;, @HomeDrive) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
; Shell Execute a selected folder.&lt;br /&gt;
Func _ShellExecuteFileSelectFolder($sText, $sRoot, $iFlag = 0, $sInitialDir = &#039;&#039;, $hWnd = &#039;&#039;)&lt;br /&gt;
    Local $sFolder = FileSelectFolder($sText, $sRoot, $iFlag, $sInitialDir, $hWnd)&lt;br /&gt;
    If @error Then&lt;br /&gt;
        Return SetError(@error, @extended, &#039;&#039;)&lt;br /&gt;
    EndIf&lt;br /&gt;
    ShellExecute($sFolder)&lt;br /&gt;
    Return $sFolder&lt;br /&gt;
EndFunc   ;==&amp;gt;_ShellExecuteFileSelectFolder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _SuiCide ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 28010-larrydalooza&lt;br /&gt;
 | AuthorName = LarryDalooza&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION&lt;br /&gt;
; Deletes the running script&lt;br /&gt;
&lt;br /&gt;
Func SuiCide()&lt;br /&gt;
	Local $sFilePath = @TempDir &amp;amp; &#039;\SuiCide.bat&#039;&lt;br /&gt;
	FileDelete($sFilePath)&lt;br /&gt;
	FileWrite($sFilePath, &#039;loop:&#039; &amp;amp; @CRLF &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;ping -n 1 -w 250 zxywqxz_q&#039; &amp;amp; @CRLF &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; _&lt;br /&gt;
			&#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF &amp;amp; &#039;del SuiCide.bat&#039; &amp;amp; @CRLF)&lt;br /&gt;
	Exit Run($sFilePath, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc   ;==&amp;gt;SuiCide&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== _UniqueFilename ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 35302-guinness&lt;br /&gt;
 | AuthorName = guinness&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(_UniqueFilename(@ScriptDir, &#039;.au3&#039;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _UniqueFilename($sFilePath, $sExtension)&lt;br /&gt;
    Local $iRandom = 0, $sUnqiueFileName = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    $sExtension = &#039;.&#039; &amp;amp; StringRegExpReplace($sExtension, &#039;\A[\.]+&#039;, &#039;&#039;)&lt;br /&gt;
    $sFilePath = StringRegExpReplace($sFilePath, &#039;[\\/]+\z&#039;, &#039;&#039;) &amp;amp; &#039;\&#039;&lt;br /&gt;
    While 1&lt;br /&gt;
        $iRandom = Random(55, 116, 1)&lt;br /&gt;
        $sUnqiueFileName &amp;amp;= Chr($iRandom + 6 * ($iRandom &amp;gt; 90) - 7 * ($iRandom &amp;lt; 65))&lt;br /&gt;
        If FileExists($sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension) = 0 And StringLen($sUnqiueFileName) &amp;gt; 7 Then&lt;br /&gt;
            ExitLoop&lt;br /&gt;
        EndIf&lt;br /&gt;
    WEnd&lt;br /&gt;
    Return $sFilePath &amp;amp; $sUnqiueFileName &amp;amp; $sExtension&lt;br /&gt;
EndFunc   ;==&amp;gt;_UniqueFilename&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;br /&gt;
&lt;br /&gt;
== Windows - Copy With Progress ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
 | AuthorURL = 19-jos&lt;br /&gt;
 | AuthorName = Jos&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Windows - Copy With Progress&lt;br /&gt;
&lt;br /&gt;
;~ 4 Do not display a progress dialog box.&lt;br /&gt;
;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.&lt;br /&gt;
;~ 16 Respond with &amp;quot;Yes to All&amp;quot; for any dialog box that is displayed.&lt;br /&gt;
;~ 64 Preserve undo information, if possible.&lt;br /&gt;
;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.&lt;br /&gt;
;~ 256 Display a progress dialog box but do not show the file names.&lt;br /&gt;
;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.&lt;br /&gt;
;~ 1024 Do not display a user interface if an error occurs.&lt;br /&gt;
;~ 2048 Version 4.71. Do not copy the security attributes of the file.&lt;br /&gt;
;~ 4096 Only operate in the local directory. Don&#039;t operate recursively into subdirectories.&lt;br /&gt;
;~ 8192 Version 5.0. Do not copy connected files as a group. Only copy the specified files.&lt;br /&gt;
&lt;br /&gt;
_FileCopy(&amp;quot;C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe&amp;quot;,&amp;quot;C:\temp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
; to copy a directory the destination directory must exist&lt;br /&gt;
&lt;br /&gt;
Func _FileCopy($fromFile,$tofile)&lt;br /&gt;
    Local $FOF_RESPOND_YES = 16&lt;br /&gt;
    Local $FOF_SIMPLEPROGRESS = 256&lt;br /&gt;
    $winShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Windows - Built In Unzip (Windows Shell) ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
  | AuthorName = Nine&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Constants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;String.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opt(&amp;quot;MustDeclareVars&amp;quot;, 1)&lt;br /&gt;
&lt;br /&gt;
Const $sZipFile = @ScriptDir &amp;amp; &amp;quot;\Test.zip&amp;quot;&lt;br /&gt;
Const $sFolder = @ScriptDir &amp;amp; &amp;quot;\Temp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
DirRemove ($sFolder, $DIR_REMOVE)&lt;br /&gt;
UnZip($sZipFile, $sFolder)&lt;br /&gt;
If @error Then Exit MsgBox ($MB_SYSTEMMODAL,&amp;quot;&amp;quot;,&amp;quot;Error unzipping files : &amp;quot; &amp;amp; @error)&lt;br /&gt;
&lt;br /&gt;
Func UnZip($sZipFile, $sDestFolder)&lt;br /&gt;
  If Not FileExists($sZipFile) Then Return SetError (1) ; source file does not exists&lt;br /&gt;
  If Not FileExists($sDestFolder) Then&lt;br /&gt;
    If Not DirCreate($sDestFolder) Then Return SetError (2) ; unable to create destination&lt;br /&gt;
  Else&lt;br /&gt;
    If Not StringInStr(FileGetAttrib($sDestFolder), &amp;quot;D&amp;quot;) Then Return SetError (3) ; destination not folder&lt;br /&gt;
  EndIf&lt;br /&gt;
  Local $oShell = ObjCreate(&amp;quot;shell.application&amp;quot;)&lt;br /&gt;
  Local $oZip = $oShell.NameSpace($sZipFile)&lt;br /&gt;
  Local $iZipFileCount = $oZip.items.Count&lt;br /&gt;
  If Not $iZipFileCount Then Return SetError (4) ; zip file empty&lt;br /&gt;
  For $oFile In $oZip.items&lt;br /&gt;
    $oShell.NameSpace($sDestFolder).copyhere($ofile)&lt;br /&gt;
  Next&lt;br /&gt;
EndFunc   ;==&amp;gt;UnZip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[#top | ReturnToContents]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14372</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14372"/>
		<updated>2020-07-27T11:44:15Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives an email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
Search &#039;&#039;&#039;DisableTNEF&#039;&#039;&#039; for alternatives.&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
NOTE: Using the &#039;&#039;&#039;reg command line tool /f switch&#039;&#039;&#039; it is possible to silently add a non-existing value.&lt;br /&gt;
&lt;br /&gt;
C:\AutoIt&amp;gt;&#039;&#039;&#039;reg add HKEY_CURRENT_USER\Software\Microsoft\Office\7.0\Outlook\Preferences /v DisableTNEF /t REG_DWORD /d 1 /f&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The operation completed successfully.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14296</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14296"/>
		<updated>2020-04-21T09:48:40Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Windows Registry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
Search &#039;&#039;&#039;DisableTNEF&#039;&#039;&#039; for alternatives&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
NOTE: Using the &#039;&#039;&#039;reg command line tool /f switch&#039;&#039;&#039; it is possible to silently add a non-existing value.&lt;br /&gt;
&lt;br /&gt;
C:\AutoIt&amp;gt;&#039;&#039;&#039;reg add HKEY_CURRENT_USER\Software\Microsoft\Office\7.0\Preferences /v DisableTNEF /t REG_DWORD /d 1 /f&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The operation completed successfully.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14295</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14295"/>
		<updated>2020-04-21T09:48:15Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Windows Registry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
Search &#039;&#039;&#039;DisableTNEF&#039;&#039;&#039; for alternatives&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
NOTE: Using the &#039;&#039;&#039;reg command line tool /f switch&#039;&#039;&#039; it is possible to add a non-existing value.&lt;br /&gt;
&lt;br /&gt;
C:\AutoIt&amp;gt;&#039;&#039;&#039;reg add HKEY_CURRENT_USER\Software\Microsoft\Office\7.0\Preferences /v DisableTNEF /t REG_DWORD /d 1 /f&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The operation completed successfully.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14294</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14294"/>
		<updated>2020-04-21T09:48:00Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Windows Registry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
Search &#039;&#039;&#039;DisableTNEF&#039;&#039;&#039; for alternatives&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
NOTE: Using the &#039;&#039;&#039;reg command line tool /f switch&#039;&#039;&#039; it is possible to add a non-existing value.&lt;br /&gt;
C:\AutoIt&amp;gt;&#039;&#039;&#039;reg add HKEY_CURRENT_USER\Software\Microsoft\Office\7.0\Preferences /v DisableTNEF /t REG_DWORD /d 1 /f&#039;&#039;&#039;&lt;br /&gt;
The operation completed successfully.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14288</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14288"/>
		<updated>2020-04-21T08:21:30Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
Search &#039;&#039;&#039;DisableTNEF&#039;&#039;&#039; for alternatives&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14287</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14287"/>
		<updated>2020-04-21T08:07:25Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
* Go to File Options Mail Send Messages section.&lt;br /&gt;
* Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14286</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14286"/>
		<updated>2020-04-21T08:06:55Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
* Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
    * Go to File Options Mail Send Messages section.&lt;br /&gt;
    * Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14285</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14285"/>
		<updated>2020-04-21T08:02:44Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Microsoft Office */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (337 UDFs on 2020/04/20), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Latest modifications&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! section !! creator !! title&lt;br /&gt;
|-&lt;br /&gt;
| 2020-04-20 || Script Coding/Analyzing/Debugging || MrCreatoR || Highlight AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
|-&lt;br /&gt;
| 2020-03-10 || Encryption and hash || RTFC || Encrypt scripts without placing the key inside the script. &lt;br /&gt;
|-&lt;br /&gt;
| 2019-12-02 || Encryption and hash || TheXman || Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-11-18 || Script Coding/Analyzing/Debugging || LarsJ || Create/access/process Variants and SafeArrays.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-09-29 || Inter Process Communications || tarretarretarre || Autoit-Socket-IO - Networking in AutoIt made simple!.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-09-03 || Windows || water || TaskScheduler - Brushed up Task Scheduler UDF.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-05-17 || GUI additions || S3cret91 || Notify - Display permanent desktop notifications.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-05-17 || Script Coding/Analyzing/Debugging || user4157124 || AutoIt error logger (AUERLO) - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-05-10 || GUI additions || NHD || Wi3SMenu - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-05-08 || Hardware || RTFC || BuildPartitionTable - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
|-&lt;br /&gt;
| 2019-05-05 || All sections || water || Changed all links from http to https&lt;br /&gt;
|-&lt;br /&gt;
| 2019-04-01 || Multiple sections || Ward || Seems Ward left the forum and has removed all UDFs he created :-(&lt;br /&gt;
|-&lt;br /&gt;
| 2019-03-28 || Files, Databases and web connections || TheXman || jq - A powerful and flexible JSON processor based on jq&lt;br /&gt;
|-&lt;br /&gt;
| 2019-03-14 || Script Coding/Analyzing/Debugging || Yashied || Log UDF - Allows to create text log files&lt;br /&gt;
|-&lt;br /&gt;
| 2019-02-25 || Files, Databases and web connections || seangriffin || CSV - Manipulate CSV files&lt;br /&gt;
|-&lt;br /&gt;
| 2019-02-22 || GUI additions || Taskms4 || MTSkin - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins)&lt;br /&gt;
|-&lt;br /&gt;
| 2019-01-27 || Microsoft Office || water || Outlook Tools - Import/export contacts from/to vcf files and calendar events from/to ics files&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
* [[Known issues with Microsoft Office automation.]]&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (by water)] - Automate Microsoft Outlook. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=480 Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory. Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=454 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - This simple UDF allows you to create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Autoit-Socket-IO is a event driven TCP/IP wrapper heavily inspired from Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organised Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation UDF (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML UDF (by FireFox)] - UDF to work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - EzMySql - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - UDF to generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - A powerful and flexible JSON processor based on jq.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - This autoIt UDF is built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 UDF (by schoppet)] - UDF to access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database UDF (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx UDF (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O UDF (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121985 AutoIt Machine Code Algorithm Collection (by Ward)] - &amp;lt;s&amp;gt;Checksum, Compression, Encode and hash algorithm collection for 32 and 64 bit.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112273 LZMA Compression (by Ward)] - &amp;lt;s&amp;gt;LZMA Compression UDF.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166634 MessagePack (by Ward)] - &amp;lt;s&amp;gt;Efficient binary serialization format to exchange data among multiple languages like JSON - but faster and smaller.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128962 zLib (by Ward)] - &amp;lt;s&amp;gt;zLib (Deflate/Inflate/GZIP) UDF.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=78745 AES Rijndael (by Ward)] - &amp;lt;s&amp;gt;Very fast AES UDF. Supports ECB/CBC/CFB/OFB block cipher mode.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121985 AutoIt Machine Code Algorithm Collection (by Ward)] - &amp;lt;s&amp;gt;Checksum, Compression, Encode and hash algorithm collection for 32 and 64 bit.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode (calling functions &amp;quot;CryptBinaryToString&amp;quot; and &amp;quot;CryptStringToBinary&amp;quot; in Crypt32.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76976 MD5,SHA1,CRC32,RC4,BASE64,XXTEA (by Ward)] - &amp;lt;s&amp;gt;Several encryption and hash functions.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - A library that allows a user to skin their application GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - A large library that allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - It sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/154727-buildpartitiontable BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/155674-commapi-serial-and-parallel-communication-with-windows-api/ CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173067 cURL (by Ward)] - &amp;lt;s&amp;gt;AutoIt binary code version of libcurl with SSL support.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* &amp;lt;strike&amp;gt;[https://www.autoitscript.com/forum/index.php?showtopic=64051 POP3 SSL (by Fox2)] - A POP3 library that&#039;s compatible with Gmail. It uses an external executable that must be supplied with your script.&amp;lt;/strike&amp;gt; No code attached to the thread.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173129 Request (by Ward)] - &amp;lt;s&amp;gt;Powerful and easy-to-use HTTP client for AutoIt based on Curl.au3 and Json.au3.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - This library allows you to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=130263 AVI writing udf (by monoceres)] -  UDF for creating uncompressed avi:s from bitmap files (support for compressing the video, may or may not appear).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - This is an UDF for reading info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files UDF also retreive various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - With this UDF you can simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot UDF (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Twitter UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - YWeather UDF - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil UDF (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Local account UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper UDF (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF.&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS UDF (by Kanashius)] - UDF for use with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - A UDF for manipulating Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=131037 Binary (by Ward)] - &amp;lt;s&amp;gt;Functions to better deal with binary variables.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162366 BinaryCall (by Ward)] - &amp;lt;s&amp;gt;Write Subroutines In C, Call In AutoIt.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111613 FASM (by Ward)] - &amp;lt;s&amp;gt;Embed compiled Flat Assembler (FASM) code in your script.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86672 Inline Assembly (by Ward)] - &amp;lt;s&amp;gt;Assembles the code to binary machine code and runs it.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77463 MemoryDll (by Ward)] - &amp;lt;s&amp;gt;Embed DLLs in script and call functions from memory.&amp;lt;/s&amp;gt; File removed by author.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14284</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14284"/>
		<updated>2020-04-21T08:01:38Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&#039;&#039;&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
* Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
    Go to File Options Mail Send Messages section.&lt;br /&gt;
    Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14283</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14283"/>
		<updated>2020-04-21T07:59:21Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
Microsoft does not provide a single &amp;quot;Do not use TNEF&amp;quot; configuration item. Settings are dispersed over several interfaces.&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;br /&gt;
&lt;br /&gt;
==== Windows Registry ====&lt;br /&gt;
&lt;br /&gt;
I added a DWORD named &amp;quot;DisableTNEF&amp;quot; to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1.&lt;br /&gt;
From [https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2016-winmaildat-problem-have-tried-all/f9f15b95-7fdc-4f1c-a1d9-047358747ef8 Microsoft Answers]&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2016 ====&lt;br /&gt;
If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:&lt;br /&gt;
* Click the File tab, click Options, and then click on Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
* Also clear any preferences associated with Outlook’s auto complete list.&lt;br /&gt;
    Go to File Options Mail Send Messages section.&lt;br /&gt;
    Click Empty Auto-Complete List&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2013 &amp;amp; 2010 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* Click the File tab, click Options, and then click Mail.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK.&lt;br /&gt;
&lt;br /&gt;
==== In Outlook 2007 ====&lt;br /&gt;
To turn off TNEF, follow these steps:&lt;br /&gt;
* On the Tools menu, click Options and then click the Mail Format tab.&lt;br /&gt;
* In the Compose in this message format list, click Plain Text or HTML, and then click OK&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14282</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14282"/>
		<updated>2020-04-21T07:52:51Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&#039;&#039;&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14281</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14281"/>
		<updated>2020-04-21T07:52:17Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format.&lt;br /&gt;
From [https://capsulecrm.com/support/microsoft-tnef/ Capsule CRM]&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;br /&gt;
These include &amp;quot;Sending in Rich Text Format&amp;quot;. The mail is not sent in RTF but rather forces TNEF encoding.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the Senders use of TNEF, this problem may be mitigated.&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14280</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14280"/>
		<updated>2020-04-21T07:46:54Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem ===&lt;br /&gt;
&lt;br /&gt;
Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives and email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.&lt;br /&gt;
&lt;br /&gt;
=== The Cause ===&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;br /&gt;
&lt;br /&gt;
==== Look out for ====&lt;br /&gt;
&lt;br /&gt;
Microsoft uses &amp;quot;aliases&amp;quot; for the TNEF model.&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14279</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14279"/>
		<updated>2020-04-21T07:43:32Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.&lt;br /&gt;
&lt;br /&gt;
== Microsoft Outlook Email WINMAIL.DAT ==&lt;br /&gt;
&lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14278</id>
		<title>Known issues with Microsoft Office automation.</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Known_issues_with_Microsoft_Office_automation.&amp;diff=14278"/>
		<updated>2020-04-21T07:40:27Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: Created page with &amp;quot;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&amp;#039;s Windows and Office products are propri...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft&#039;s Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required.  It should be noted that some of these issues change over different versions, resulting in &amp;quot;unexplained&amp;quot; errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
&lt;br /&gt;
Microsoft &lt;br /&gt;
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.&lt;br /&gt;
Fronm this page: [https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format Wikipedia.org Transport Neutral Encapsulation Format]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13739</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13739"/>
		<updated>2017-12-04T09:41:15Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements and uses an &#039;&#039;Object Oriented Programming&#039;&#039;-like approach to encapsulate data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13738</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13738"/>
		<updated>2017-12-04T09:40:46Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements and uses an &#039;&#039;Object Oriented Programming&#039;&#039;-like approach to encapsulate data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13737</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13737"/>
		<updated>2017-12-01T11:24:54Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
The next example creates an array from user input and then compares elements from a 1D Array to the first column of a 2D array to return the matches as words.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; sample number string split and convert to words&lt;br /&gt;
; uncomment the ConsoleWrite and _ArrayDisplay lines to see what it does&lt;br /&gt;
;# some includes&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;# some variables&lt;br /&gt;
&lt;br /&gt;
;Create 2D array to display&lt;br /&gt;
Local $aWords[10][2] = [[0, &#039;nil&#039;] _&lt;br /&gt;
		, [1, &#039;one&#039;] _&lt;br /&gt;
		, [2, &#039;two&#039;] _&lt;br /&gt;
		, [3, &#039;three&#039;] _&lt;br /&gt;
		, [4, &#039;four&#039;] _&lt;br /&gt;
		, [5, &#039;five&#039;] _&lt;br /&gt;
		, [6, &#039;six&#039;] _&lt;br /&gt;
		, [7, &#039;seven&#039;] _&lt;br /&gt;
		, [8, &#039;eight&#039;] _&lt;br /&gt;
		, [9, &#039;nine&#039;]] ; :)&lt;br /&gt;
&lt;br /&gt;
;~ _ArrayDisplay($aWords)&lt;br /&gt;
&lt;br /&gt;
; the order of the sample digits is to show that the comparison below is accurate, from left to right&lt;br /&gt;
Local $Originalinput = InputBox(&amp;quot;Type a number&amp;quot;, &amp;quot;A number?&amp;quot;,&amp;quot;97524601&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Local $userinput = $Originalinput ; pass the orginal input to a second var&lt;br /&gt;
; now parse the userinput to that we know what was submitted, then repeat in words&lt;br /&gt;
; first strip all white space&lt;br /&gt;
$userinput = StringStripWS($userinput, 8)&lt;br /&gt;
&lt;br /&gt;
If StringIsDigit($userinput) Then ; continue&lt;br /&gt;
&lt;br /&gt;
	; now get the length of the string&lt;br /&gt;
	Local $islong = StringLen($userinput)&lt;br /&gt;
&lt;br /&gt;
	; make an array with size = length to insert items into&lt;br /&gt;
	Local $aInput[1] ; create blank one dimensional array&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; eat the string one digit at a time :)&lt;br /&gt;
	Local $oneleft&lt;br /&gt;
	For $i = 1 To $islong Step 1&lt;br /&gt;
		$oneleft = StringLeft($userinput, 1)&lt;br /&gt;
		ConsoleWrite(&amp;quot;$oneleft: &amp;quot; &amp;amp; $oneleft &amp;amp; @CRLF)&lt;br /&gt;
		$userinput = StringTrimLeft($userinput, 1) ; make the $userinput one shorter on each loop&lt;br /&gt;
		_ArrayAdd($aInput, $oneleft, 1)&lt;br /&gt;
	Next&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; now write out what the user typed in words&lt;br /&gt;
&lt;br /&gt;
;~ 	ConsoleWrite(&amp;quot;How long is the string: &amp;quot; &amp;amp; $islong &amp;amp; @CRLF)&lt;br /&gt;
; compare the user input to our defined array&lt;br /&gt;
	For $k = 0 To $islong Step 1&lt;br /&gt;
		For $j = 0 To (UBound($aWords) - 1) Step 1&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;Compare $j &amp;quot; &amp;amp; $aWords[$j][0] &amp;amp; &amp;quot; to $k &amp;quot; &amp;amp; $aInput[$k] &amp;amp; @CRLF)&lt;br /&gt;
			If $aWords[$j][0] == $aInput[$k] Then&lt;br /&gt;
				MsgBox(0, &amp;quot;Number to word&amp;quot;, $Originalinput&amp;amp;@CRLF&amp;amp;&amp;quot;User typed &amp;quot;&amp;amp; $aInput[$k]&amp;amp; @CRLF &amp;amp; $aWords[$j][1] &amp;amp; @CRLF,1)&lt;br /&gt;
			EndIf&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;For... Next inner loops: &amp;quot; &amp;amp; $k &amp;amp; @CRLF)&lt;br /&gt;
		Next&lt;br /&gt;
;~ 		ConsoleWrite(&amp;quot;For... Next outer loops: &amp;quot; &amp;amp; $j &amp;amp; @CRLF)&lt;br /&gt;
	Next&lt;br /&gt;
&lt;br /&gt;
EndIf ; if its not digits, skip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, as a general rule, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
You can access the elements of these embedded arrays directly (note the additional () required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $aContainerArray[2]&lt;br /&gt;
Local $aInternalArray_0[2] = [&amp;quot;Internal-0-0&amp;quot;,&amp;quot;Internal-0-1&amp;quot;]&lt;br /&gt;
Local $aInternalArray_1[2] = [&amp;quot;Internal-1-0&amp;quot;,&amp;quot;Internal-1-1&amp;quot;]&lt;br /&gt;
$aContainerArray[0] = $aInternalArray_0&lt;br /&gt;
$aContainerArray[1] = $aInternalArray_1&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&amp;quot;1 element of InternalArray_0: &amp;quot; &amp;amp; ($aContainerArray[0])[1] &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(&amp;quot;0 element of InternalArray_1: &amp;quot; &amp;amp; ($aContainerArray[1])[0] &amp;amp; @CRLF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. See the [[Associative Arrays]] page for more information.&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13736</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13736"/>
		<updated>2017-11-30T10:58:37Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements and uses an &#039;&#039;Object Oriented Programming&#039;&#039;-like approach to encapsulate data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13735</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13735"/>
		<updated>2017-11-30T10:57:42Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements and uses an Object Oriented Programming approach to encapsulate data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13734</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13734"/>
		<updated>2017-11-30T10:48:24Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13733</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13733"/>
		<updated>2017-11-30T10:45:26Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a &#039;&#039;native&#039;&#039; AutoIt internal process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13732</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13732"/>
		<updated>2017-11-30T10:44:50Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on a native AutoIt &#039;&#039;internal&#039;&#039; process handling named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13731</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13731"/>
		<updated>2017-11-30T10:35:19Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard &#039;&#039;&#039;&#039;&#039;object&#039;&#039;&#039;&#039;&#039; provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on AutoIt internally processing named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13730</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13730"/>
		<updated>2017-11-30T10:34:20Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on AutoIt internally processing named array elements, with no reference to the Scripting Dictionary.  The second method relies on the Scripting Dictionary to create and manage associative arrays.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13729</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13729"/>
		<updated>2017-11-30T10:31:06Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on AutoIt internally processing named array elements.  The second method makes use of the Scripting Dictionary.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
__________________________________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
While the examples above use the Scripting Dictionary method, the example below by guinness does not use the Scripting Dictionary.  Also see [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/ this discussion] by Nutster, with Associative Array management tools. &lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13728</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13728"/>
		<updated>2017-11-30T10:24:28Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;Note:&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on AutoIt internally processing named array elements.  The second method makes use of the Scripting Dictionary.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13727</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13727"/>
		<updated>2017-11-30T10:23:57Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;lt;big&amp;gt;&amp;gt;Note:&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
AutoIt allows for at least two different implementations of Associative Arrays.  The first method relies on AutoIt internally processing named array elements.  The second method makes use of the Scripting Dictionary.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13726</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13726"/>
		<updated>2017-11-30T10:13:31Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion by &#039;&#039;&#039;Nutster&#039;&#039;&#039; explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13725</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13725"/>
		<updated>2017-11-30T10:12:51Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.  A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.  Please see the Include file and an exerciser that demonstrates how to use the associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13724</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13724"/>
		<updated>2017-11-30T10:11:31Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This discussion explains the [https://www.autoitscript.com/forum/topic/59174-associative-array-functions/#comment-445963 original implementation] of Associative Arrays in AutoIt. &lt;br /&gt;
    An associative array is an array where the keys (index numbers) are string instead of integer, as they are in AutoIt. Linux / Unix awk and perl use associative arrays by default. The following functions can be used to manage a version of associative arrays in single AutoIt variables.&lt;br /&gt;
&lt;br /&gt;
A hash table is used to store the values because it is faster to insert than other options I can think of and pretty much as fast as them to retrieve the data. The memory requirements are a little higher than other methods, but I think it is a reasonable trade-off. It uses a simple hash function that can probably be easily improved upon and while it can resize the hash table, the resize is slow so try to make your initial size large enough for all your elements.&lt;br /&gt;
&lt;br /&gt;
Attached please find an Include file and an exerciser that demonstrates how to use my associative array functions. Read the comments at the top of each function for more details on their use.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13723</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13723"/>
		<updated>2017-11-28T14:13:29Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray _AssocArray] &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13722</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13722"/>
		<updated>2017-11-28T14:11:42Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Please also see this entry in the Snippets section of this Wiki [[https://www.autoitscript.com/wiki/Snippets_(_AutoIt_Array_)#AssocArray|_AssocArray]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13721</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13721"/>
		<updated>2017-11-28T11:02:35Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
_____________________________________________________&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13720</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13720"/>
		<updated>2017-11-28T10:56:42Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13719</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13719"/>
		<updated>2017-11-28T10:56:09Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A &#039;&#039;&#039;Scripting.Dictionary&#039;&#039;&#039;&#039;&#039;Italic text&#039;&#039; is a standard object provided by the &#039;&#039;&#039;Microsoft Scripting Runtime&#039;&#039;&#039; (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13718</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13718"/>
		<updated>2017-11-28T10:50:44Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The next example does not use the scripting dictionary UDF, but makes use of Global Enumerators.  This allows access to data through named elements.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author   guinness&lt;br /&gt;
; Forum    https://www.autoitscript.com/forum/topic/173803-oop-like-approach-in-autoit/&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ---- Start of Person Class&lt;br /&gt;
&lt;br /&gt;
; Stored in the &#039;object&#039; to verify it&#039;s our &#039;object&#039; and not some random array&lt;br /&gt;
Global Const $PERSON_GUID = &#039;4197B285-6AB1-489B-8585-08C852E33F3D&#039;&lt;br /&gt;
&lt;br /&gt;
; Friendly names for 0, 1, 2 and 3&lt;br /&gt;
Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX&lt;br /&gt;
&lt;br /&gt;
; Constructor&lt;br /&gt;
Func Person($sName, $iAge)&lt;br /&gt;
    Local $hPerson[$PERSON_MAX]&lt;br /&gt;
&lt;br /&gt;
    ; Set the GUID, so as the verification will work&lt;br /&gt;
    $hPerson[$PERSON_ID] = $PERSON_GUID&lt;br /&gt;
&lt;br /&gt;
    Person_SetAge($hPerson, $iAge)&lt;br /&gt;
    Person_SetName($hPerson, $sName)&lt;br /&gt;
&lt;br /&gt;
    ; Return the Person &#039;object&#039;&lt;br /&gt;
    Return $hPerson&lt;br /&gt;
EndFunc   ;==&amp;gt;Person&lt;br /&gt;
&lt;br /&gt;
; Getter for the age property&lt;br /&gt;
Func Person_GetAge(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetAge&lt;br /&gt;
&lt;br /&gt;
; Setter for the age property&lt;br /&gt;
Func Person_SetAge(ByRef $hPerson, $iAge)&lt;br /&gt;
    ; If not a valid &#039;object&#039; or integer then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the age&lt;br /&gt;
    $hPerson[$PERSON_AGE] = $iAge&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetAge&lt;br /&gt;
&lt;br /&gt;
; Getter for the name property&lt;br /&gt;
Func Person_GetName(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_GetName&lt;br /&gt;
&lt;br /&gt;
; Setter for the name property&lt;br /&gt;
Func Person_SetName(ByRef $hPerson, $sName)&lt;br /&gt;
    ; If not a valid &#039;object&#039; then return&lt;br /&gt;
    If Not _Person_IsObject($hPerson) Then Return&lt;br /&gt;
&lt;br /&gt;
    ; Set the name&lt;br /&gt;
    $hPerson[$PERSON_NAME] = $sName&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_SetName&lt;br /&gt;
&lt;br /&gt;
; ToString() for the &#039;object&#039;&lt;br /&gt;
Func Person_ToString(ByRef $hPerson)&lt;br /&gt;
    Return _Person_IsObject($hPerson) ? StringFormat(&#039;Name: %s, Age: %i&#039;, $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null&lt;br /&gt;
EndFunc   ;==&amp;gt;Person_ToString&lt;br /&gt;
&lt;br /&gt;
; Check if it&#039;s a valid &#039;object&#039; and not some random array. &amp;quot;NTERNAL ONLY!&lt;br /&gt;
Func _Person_IsObject(ByRef $hPerson)&lt;br /&gt;
    Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID&lt;br /&gt;
EndFunc   ;==&amp;gt;_Person_IsObject&lt;br /&gt;
&lt;br /&gt;
; ---- End of Person Class&lt;br /&gt;
&lt;br /&gt;
Example()&lt;br /&gt;
&lt;br /&gt;
Func Example()&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP1 = Person(&#039;John&#039;, 30)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 1&#039;, Person_ToString($hP1))&lt;br /&gt;
&lt;br /&gt;
    ; Create a new person&lt;br /&gt;
&lt;br /&gt;
    ; Store the Person &#039;object&#039;, which is just a glorified array&lt;br /&gt;
    Local $hP2 = Person(&#039;James&#039;, 36)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2&#039;, Person_ToString($hP2))&lt;br /&gt;
&lt;br /&gt;
    ; Set the age for Person 2&lt;br /&gt;
    Person_SetAge($hP2, 45)&lt;br /&gt;
&lt;br /&gt;
    ; Display the &#039;object&#039;&lt;br /&gt;
    MsgBox($MB_SYSTEMMODAL, &#039;Person 2 - Revised&#039;, Person_ToString($hP2))&lt;br /&gt;
EndFunc   ;==&amp;gt;Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13717</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13717"/>
		<updated>2017-11-28T10:44:43Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A few notes on Associative Arrays:&amp;lt;br /&amp;gt;&lt;br /&gt;
* Think of an associative array as an array with named elements&lt;br /&gt;
* Comparisons can be exact (binary) or case insensitive (alpha)&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
At the time of writing this - 28 November 2017 - a new &#039;&#039;&#039;map data type&#039;&#039;&#039; is under development for AutoIt. It is availabe in the current [https://www.autoitscript.com/forum/topic/163657-maps-beta/?do=findComment&amp;amp;comment=1296278 beta release].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the current beta for more information on map functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13716</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13716"/>
		<updated>2017-11-28T10:30:10Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum &lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Example 2 is a reply to a common question asked on the Forum, How to find duplicate lines/values... &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Malkey &lt;br /&gt;
;        https://www.autoitscript.com/forum/profile/31256-malkey/&lt;br /&gt;
; Forum  https://www.autoitscript.com/forum/topic/116156-best-way-to-compare-strings-for-duplicates/?do=findComment&amp;amp;comment=810752&lt;br /&gt;
Local $sStr, $begin, $dif, $sMatches&lt;br /&gt;
&lt;br /&gt;
; Create random test data&lt;br /&gt;
For $i = 1 To 1000&lt;br /&gt;
    $sStr &amp;amp;= Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; _&lt;br /&gt;
            Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; Chr(Random(Asc(&amp;quot;a&amp;quot;), Asc(&amp;quot;z&amp;quot;), 1)) &amp;amp; @CRLF ;&lt;br /&gt;
Next&lt;br /&gt;
;ConsoleWrite($sStr &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
$begin = TimerInit()&lt;br /&gt;
&lt;br /&gt;
Local $oDict = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;) ; to create a dictionary object&lt;br /&gt;
Local $aArray = StringSplit(StringStripWS($sStr, 2), @CRLF, 3)&lt;br /&gt;
For $i = 0 To UBound($aArray) - 1&lt;br /&gt;
    If $oDict.Exists($aArray[$i]) Then&lt;br /&gt;
        $sMatches &amp;amp;= $i &amp;amp; &amp;quot; &amp;quot; &amp;amp; $aArray[$i] &amp;amp; @CRLF ; Record duplicates&lt;br /&gt;
    Else&lt;br /&gt;
        $oDict.add($aArray[$i], &#039;&#039;) ; to store a string (you may set $value = &#039;&#039; if you have no use of it)&lt;br /&gt;
    EndIf&lt;br /&gt;
Next&lt;br /&gt;
$dif = Round(TimerDiff($begin) / 1000, 3) &amp;amp; &amp;quot; secs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;Display results&lt;br /&gt;
If $sMatches &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, StringTrimRight($sMatches, 2) &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
Else&lt;br /&gt;
    MsgBox(0, &amp;quot;Results&amp;quot;, &amp;quot;No duplicates found&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Time taken = &amp;quot; &amp;amp; $dif)&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13715</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13715"/>
		<updated>2017-11-28T10:27:00Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum &lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Below are several examples that illustrate the usage of the Scripting Dictionary UDF in AutoIt.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Jefrey&lt;br /&gt;
; Forum https://www.autoitscript.com/forum/profile/75137-jefrey/&lt;br /&gt;
#include &#039;scriptingdic.au3&#039;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt; ; Needed only for _ArrayDisplay, and not required by the lib&lt;br /&gt;
&lt;br /&gt;
; Init the object&lt;br /&gt;
$oObj = _InitDictionary()&lt;br /&gt;
&lt;br /&gt;
; Adding a single value&lt;br /&gt;
_AddItem($oObj, 0, &amp;quot;Test&amp;quot;)&lt;br /&gt;
; And showing it&lt;br /&gt;
msgbox(0, &#039;&#039;, _Item($oObj, 0))&lt;br /&gt;
&lt;br /&gt;
; Adding an array&lt;br /&gt;
Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1]&lt;br /&gt;
_AddItem($oObj, 1, $aArr)&lt;br /&gt;
; And showing it&lt;br /&gt;
_ArrayDisplay(_Item($oObj, 1))&lt;br /&gt;
&lt;br /&gt;
; We can also use this approach:&lt;br /&gt;
$oObj3 = _InitDictionary()&lt;br /&gt;
$oObj.Add(&amp;quot;test&amp;quot;, &amp;quot;foo&amp;quot;)&lt;br /&gt;
MsgBox(0, &#039;&#039;, $oObj.Item(&amp;quot;test&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13714</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13714"/>
		<updated>2017-11-28T10:24:05Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
; Author Mhz&lt;br /&gt;
; Forum &lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The original AutoIt Scripting Dictionary implementation appears to have been by Gary Frost as far back as 2007.  It has since been modified to the following:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
#cs&lt;br /&gt;
	Scripting Dictionary UDF&lt;br /&gt;
&lt;br /&gt;
	Made by GaryFrost &amp;lt;https://www.autoitscript.com/forum/topic/47048-scripting-dictionary/&amp;gt;&lt;br /&gt;
	Modified by Jefrey &amp;lt;jefrey[at]jefrey.ml&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	Forum https://www.autoitscript.com/forum/topic/182334-scripting-dictionary-modified/&lt;br /&gt;
	&lt;br /&gt;
#ce&lt;br /&gt;
&lt;br /&gt;
Func _InitDictionary()&lt;br /&gt;
	Return ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_InitDictionary&lt;br /&gt;
&lt;br /&gt;
; Adds a key and item pair to a Dictionary object.&lt;br /&gt;
Func _AddItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.ADD($v_key, $v_item)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_AddItem&lt;br /&gt;
&lt;br /&gt;
; Returns true if a specified key exists in the Dictionary object, false if it does not.&lt;br /&gt;
Func _ItemExists($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Exists($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemExists&lt;br /&gt;
&lt;br /&gt;
; Returns an item for a specified key in a Dictionary object&lt;br /&gt;
Func _Item($oDictionary, $v_key)&lt;br /&gt;
	Return $oDictionary.Item($v_key)&lt;br /&gt;
EndFunc   ;==&amp;gt;_Item&lt;br /&gt;
&lt;br /&gt;
; Sets an item for a specified key in a Dictionary object&lt;br /&gt;
Func _ChangeItem($oDictionary, $v_key, $v_item)&lt;br /&gt;
	$oDictionary.Item($v_key) = $v_item&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeItem&lt;br /&gt;
&lt;br /&gt;
; Sets a key in a Dictionary object.&lt;br /&gt;
Func _ChangeKey($oDictionary, $v_key, $v_newKey)&lt;br /&gt;
	$oDictionary.Key($v_key) = $v_newKey&lt;br /&gt;
EndFunc   ;==&amp;gt;_ChangeKey&lt;br /&gt;
&lt;br /&gt;
; Removes a key, item pair from a Dictionary object.&lt;br /&gt;
Func _ItemRemove($oDictionary, $v_key)&lt;br /&gt;
	$oDictionary.Remove($v_key)&lt;br /&gt;
	If @error Then Return SetError(1, 1, -1)&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemRemove&lt;br /&gt;
&lt;br /&gt;
; Returns the number of items in a collection or Dictionary object.&lt;br /&gt;
Func _ItemCount($oDictionary)&lt;br /&gt;
	Return $oDictionary.Count&lt;br /&gt;
EndFunc   ;==&amp;gt;_ItemCount&lt;br /&gt;
&lt;br /&gt;
; Returns an array containing all the items in a Dictionary object&lt;br /&gt;
Func _GetItems($oDictionary)&lt;br /&gt;
	Return $oDictionary.Items&lt;br /&gt;
EndFunc   ;==&amp;gt;_GetItems&lt;br /&gt;
&lt;br /&gt;
Func _Clear($oDictionary)&lt;br /&gt;
	Return $oDictionary.RemoveAll&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13713</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13713"/>
		<updated>2017-11-28T10:17:58Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A dictionary object example by [https://www.autoitscript.com/forum/profile/2709-mhz/ MHz]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $vKey, $sItem, $sMsg, $oDictionary &lt;br /&gt;
&lt;br /&gt;
; Create dictionary object&lt;br /&gt;
$oDictionary = ObjCreate(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If @error Then&lt;br /&gt;
    MsgBox(0, &#039;&#039;, &#039;Error creating the dictionary object&#039;)&lt;br /&gt;
Else&lt;br /&gt;
    ; Add keys with items&lt;br /&gt;
    $oDictionary.Add (&amp;quot;One&amp;quot;,    &amp;quot;Same&amp;quot;  )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Two&amp;quot;,    &amp;quot;Car&amp;quot;   )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Three&amp;quot;,  &amp;quot;House&amp;quot; )&lt;br /&gt;
    $oDictionary.Add (&amp;quot;Four&amp;quot;,   &amp;quot;Boat&amp;quot;  )&lt;br /&gt;
&lt;br /&gt;
    If $oDictionary.Exists(&#039;One&#039;) Then&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x0, &#039;Item One&#039;, $oDictionary.Item(&#039;One&#039;), 2)&lt;br /&gt;
        ; Set an item&lt;br /&gt;
        $oDictionary.Item(&#039;One&#039;) = &#039;Changed&#039;&lt;br /&gt;
        ; Display item&lt;br /&gt;
        MsgBox(0x20, &#039;Did Item One Change?&#039;, $oDictionary.Item(&#039;One&#039;), 3)&lt;br /&gt;
        ; Remove key&lt;br /&gt;
        $oDictionary.Remove(&#039;One&#039;)&lt;br /&gt;
        ; &lt;br /&gt;
        $oDictionary.Key (&#039;Two&#039;) = &#039;Bike&#039;&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Store items into a variable&lt;br /&gt;
    For $vKey In $oDictionary&lt;br /&gt;
       $sItem &amp;amp;= $oDictionary.Item($vKey) &amp;amp; @CRLF&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    ; Display items&lt;br /&gt;
    MsgBox(0x0, &#039;Items Count: &#039; &amp;amp; $oDictionary.Count, $sItem, 3)&lt;br /&gt;
&lt;br /&gt;
    ; Add items into an array&lt;br /&gt;
    $aItems = $oDictionary.Items&lt;br /&gt;
&lt;br /&gt;
    ; Display items in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Items [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aItems[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
&lt;br /&gt;
    ; Add keys into an array&lt;br /&gt;
    $aKeys = $oDictionary.Keys&lt;br /&gt;
&lt;br /&gt;
    ; Display keys in the array&lt;br /&gt;
    For $i = 0 To $oDictionary.Count -1&lt;br /&gt;
        MsgBox(0x0, &#039;Keys [ &#039; &amp;amp; $i &amp;amp; &#039; ]&#039;, $aKeys[$i], 2)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13712</id>
		<title>Associative Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Associative_Arrays&amp;diff=13712"/>
		<updated>2017-11-28T09:03:27Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: Created page with &amp;quot;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible ke...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.&lt;br /&gt;
An associative array differs from a “normal” array in one major way: rather than being indexed numerically (i.e. 0, 1, 2, 3, …), it is indexed by a key, or a language-like word. &lt;br /&gt;
A Scripting.Dictionary is a standard object provided by the Microsoft ScripTing Runtime (scrrun.dll) dependency and is commonly used in VBScript, a reference to which needs to be added in order to create an object in your AutoIt project.&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13711</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13711"/>
		<updated>2017-11-28T08:58:26Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
The next example creates an array from user input and then compares elements from a 1D Array to the first column of a 2D array to return the matches as words.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; sample number string split and convert to words&lt;br /&gt;
; uncomment the ConsoleWrite and _ArrayDisplay lines to see what it does&lt;br /&gt;
;# some includes&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;# some variables&lt;br /&gt;
&lt;br /&gt;
;Create 2D array to display&lt;br /&gt;
Local $aWords[10][2] = [[0, &#039;nil&#039;] _&lt;br /&gt;
		, [1, &#039;one&#039;] _&lt;br /&gt;
		, [2, &#039;two&#039;] _&lt;br /&gt;
		, [3, &#039;three&#039;] _&lt;br /&gt;
		, [4, &#039;four&#039;] _&lt;br /&gt;
		, [5, &#039;five&#039;] _&lt;br /&gt;
		, [6, &#039;six&#039;] _&lt;br /&gt;
		, [7, &#039;seven&#039;] _&lt;br /&gt;
		, [8, &#039;eight&#039;] _&lt;br /&gt;
		, [9, &#039;nine&#039;]] ; :)&lt;br /&gt;
&lt;br /&gt;
;~ _ArrayDisplay($aWords)&lt;br /&gt;
&lt;br /&gt;
; the order of the sample digits is to show that the comparison below is accurate, from left to right&lt;br /&gt;
Local $Originalinput = InputBox(&amp;quot;Type a number&amp;quot;, &amp;quot;A number?&amp;quot;,&amp;quot;97524601&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Local $userinput = $Originalinput ; pass the orginal input to a second var&lt;br /&gt;
; now parse the userinput to that we know what was submitted, then repeat in words&lt;br /&gt;
; first strip all white space&lt;br /&gt;
$userinput = StringStripWS($userinput, 8)&lt;br /&gt;
&lt;br /&gt;
If StringIsDigit($userinput) Then ; continue&lt;br /&gt;
&lt;br /&gt;
	; now get the length of the string&lt;br /&gt;
	Local $islong = StringLen($userinput)&lt;br /&gt;
&lt;br /&gt;
	; make an array with size = length to insert items into&lt;br /&gt;
	Local $aInput[1] ; create blank one dimensional array&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; eat the string one digit at a time :)&lt;br /&gt;
	Local $oneleft&lt;br /&gt;
	For $i = 1 To $islong Step 1&lt;br /&gt;
		$oneleft = StringLeft($userinput, 1)&lt;br /&gt;
		ConsoleWrite(&amp;quot;$oneleft: &amp;quot; &amp;amp; $oneleft &amp;amp; @CRLF)&lt;br /&gt;
		$userinput = StringTrimLeft($userinput, 1) ; make the $userinput one shorter on each loop&lt;br /&gt;
		_ArrayAdd($aInput, $oneleft, 1)&lt;br /&gt;
	Next&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; now write out what the user typed in words&lt;br /&gt;
&lt;br /&gt;
;~ 	ConsoleWrite(&amp;quot;How long is the string: &amp;quot; &amp;amp; $islong &amp;amp; @CRLF)&lt;br /&gt;
; compare the user input to our defined array&lt;br /&gt;
	For $k = 0 To $islong Step 1&lt;br /&gt;
		For $j = 0 To (UBound($aWords) - 1) Step 1&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;Compare $j &amp;quot; &amp;amp; $aWords[$j][0] &amp;amp; &amp;quot; to $k &amp;quot; &amp;amp; $aInput[$k] &amp;amp; @CRLF)&lt;br /&gt;
			If $aWords[$j][0] == $aInput[$k] Then&lt;br /&gt;
				MsgBox(0, &amp;quot;Number to word&amp;quot;, $Originalinput&amp;amp;@CRLF&amp;amp;&amp;quot;User typed &amp;quot;&amp;amp; $aInput[$k]&amp;amp; @CRLF &amp;amp; $aWords[$j][1] &amp;amp; @CRLF,1)&lt;br /&gt;
			EndIf&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;For... Next inner loops: &amp;quot; &amp;amp; $k &amp;amp; @CRLF)&lt;br /&gt;
		Next&lt;br /&gt;
;~ 		ConsoleWrite(&amp;quot;For... Next outer loops: &amp;quot; &amp;amp; $j &amp;amp; @CRLF)&lt;br /&gt;
	Next&lt;br /&gt;
&lt;br /&gt;
EndIf ; if its not digits, skip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, as a general rule, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
You can access the elements of these embedded arrays directly (note the additional () required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $aContainerArray[2]&lt;br /&gt;
Local $aInternalArray_0[2] = [&amp;quot;Internal-0-0&amp;quot;,&amp;quot;Internal-0-1&amp;quot;]&lt;br /&gt;
Local $aInternalArray_1[2] = [&amp;quot;Internal-1-0&amp;quot;,&amp;quot;Internal-1-1&amp;quot;]&lt;br /&gt;
$aContainerArray[0] = $aInternalArray_0&lt;br /&gt;
$aContainerArray[1] = $aInternalArray_1&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&amp;quot;1 element of InternalArray_0: &amp;quot; &amp;amp; ($aContainerArray[0])[1] &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(&amp;quot;0 element of InternalArray_1: &amp;quot; &amp;amp; ($aContainerArray[1])[0] &amp;amp; @CRLF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
[[Associative Arrays]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13710</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13710"/>
		<updated>2017-11-28T08:56:35Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
The next example creates an array from user input and then compares elements from a 1D Array to the first column of a 2D array to return the matches as words.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; sample number string split and convert to words&lt;br /&gt;
; uncomment the ConsoleWrite and _ArrayDisplay lines to see what it does&lt;br /&gt;
;# some includes&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;# some variables&lt;br /&gt;
&lt;br /&gt;
;Create 2D array to display&lt;br /&gt;
Local $aWords[10][2] = [[0, &#039;nil&#039;] _&lt;br /&gt;
		, [1, &#039;one&#039;] _&lt;br /&gt;
		, [2, &#039;two&#039;] _&lt;br /&gt;
		, [3, &#039;three&#039;] _&lt;br /&gt;
		, [4, &#039;four&#039;] _&lt;br /&gt;
		, [5, &#039;five&#039;] _&lt;br /&gt;
		, [6, &#039;six&#039;] _&lt;br /&gt;
		, [7, &#039;seven&#039;] _&lt;br /&gt;
		, [8, &#039;eight&#039;] _&lt;br /&gt;
		, [9, &#039;nine&#039;]] ; :)&lt;br /&gt;
&lt;br /&gt;
;~ _ArrayDisplay($aWords)&lt;br /&gt;
&lt;br /&gt;
; the order of the sample digits is to show that the comparison below is accurate, from left to right&lt;br /&gt;
Local $Originalinput = InputBox(&amp;quot;Type a number&amp;quot;, &amp;quot;A number?&amp;quot;,&amp;quot;97524601&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Local $userinput = $Originalinput ; pass the orginal input to a second var&lt;br /&gt;
; now parse the userinput to that we know what was submitted, then repeat in words&lt;br /&gt;
; first strip all white space&lt;br /&gt;
$userinput = StringStripWS($userinput, 8)&lt;br /&gt;
&lt;br /&gt;
If StringIsDigit($userinput) Then ; continue&lt;br /&gt;
&lt;br /&gt;
	; now get the length of the string&lt;br /&gt;
	Local $islong = StringLen($userinput)&lt;br /&gt;
&lt;br /&gt;
	; make an array with size = length to insert items into&lt;br /&gt;
	Local $aInput[1] ; create blank one dimensional array&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; eat the string one digit at a time :)&lt;br /&gt;
	Local $oneleft&lt;br /&gt;
	For $i = 1 To $islong Step 1&lt;br /&gt;
		$oneleft = StringLeft($userinput, 1)&lt;br /&gt;
		ConsoleWrite(&amp;quot;$oneleft: &amp;quot; &amp;amp; $oneleft &amp;amp; @CRLF)&lt;br /&gt;
		$userinput = StringTrimLeft($userinput, 1) ; make the $userinput one shorter on each loop&lt;br /&gt;
		_ArrayAdd($aInput, $oneleft, 1)&lt;br /&gt;
	Next&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; now write out what the user typed in words&lt;br /&gt;
&lt;br /&gt;
;~ 	ConsoleWrite(&amp;quot;How long is the string: &amp;quot; &amp;amp; $islong &amp;amp; @CRLF)&lt;br /&gt;
; compare the user input to our defined array&lt;br /&gt;
	For $k = 0 To $islong Step 1&lt;br /&gt;
		For $j = 0 To (UBound($aWords) - 1) Step 1&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;Compare $j &amp;quot; &amp;amp; $aWords[$j][0] &amp;amp; &amp;quot; to $k &amp;quot; &amp;amp; $aInput[$k] &amp;amp; @CRLF)&lt;br /&gt;
			If $aWords[$j][0] == $aInput[$k] Then&lt;br /&gt;
				MsgBox(0, &amp;quot;Number to word&amp;quot;, $Originalinput&amp;amp;@CRLF&amp;amp;&amp;quot;User typed &amp;quot;&amp;amp; $aInput[$k]&amp;amp; @CRLF &amp;amp; $aWords[$j][1] &amp;amp; @CRLF,1)&lt;br /&gt;
			EndIf&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;For... Next inner loops: &amp;quot; &amp;amp; $k &amp;amp; @CRLF)&lt;br /&gt;
		Next&lt;br /&gt;
;~ 		ConsoleWrite(&amp;quot;For... Next outer loops: &amp;quot; &amp;amp; $j &amp;amp; @CRLF)&lt;br /&gt;
	Next&lt;br /&gt;
&lt;br /&gt;
EndIf ; if its not digits, skip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, as a general rule, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
You can access the elements of these embedded arrays directly (note the additional () required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $aContainerArray[2]&lt;br /&gt;
Local $aInternalArray_0[2] = [&amp;quot;Internal-0-0&amp;quot;,&amp;quot;Internal-0-1&amp;quot;]&lt;br /&gt;
Local $aInternalArray_1[2] = [&amp;quot;Internal-1-0&amp;quot;,&amp;quot;Internal-1-1&amp;quot;]&lt;br /&gt;
$aContainerArray[0] = $aInternalArray_0&lt;br /&gt;
$aContainerArray[1] = $aInternalArray_1&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&amp;quot;1 element of InternalArray_0: &amp;quot; &amp;amp; ($aContainerArray[0])[1] &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(&amp;quot;0 element of InternalArray_1: &amp;quot; &amp;amp; ($aContainerArray[1])[0] &amp;amp; @CRLF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
[http://www.autoitscript.com/autoit3/docs/assocarray.htm Associative Arrays]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13672</id>
		<title>Arrays</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Arrays&amp;diff=13672"/>
		<updated>2017-08-30T14:47:15Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Comparing Arrays */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;array&#039;&#039;&#039; is a [[Data_Structures|data structure]] which stores elements (variables) aligned in a computer&#039;s memory.  Arrays are referenced by an [[identifier]] (variable name) and an index specifying a desired element.  The array concept seems complex but the concept can be easily grasped.  Why are arrays so important?  The array is a fundamental data structure found in most programming languages.  &lt;br /&gt;
&lt;br /&gt;
This tutorial targets people who are beginners.  To understand how arrays work, it is imperative to try out and modify the provided samples.  Make sure that each concept is understood before the next concept is attempted.  This tutorial assumes the use of the SciTE editor.  There is a minimal version of SciTE included in the latest stable release of AutoIt (version 3.2.0.1 and above).&lt;br /&gt;
&lt;br /&gt;
== Declaring Arrays in AutoIt ==&lt;br /&gt;
&lt;br /&gt;
An array is declared in the same manner as a variable in AutoIt.  The difference is that for an array, extra information on how many elements are to be included in the array must be specified.  This information is provided by adding brackets after the identifier and a number indicating how many elements the array will possess. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Global $arr[4] ; Will make space for 4 elements.&lt;br /&gt;
Local  $arr[1] ; Will make space for 1 element.&lt;br /&gt;
Dim    $arr[3] ; Will make space for 3 elements.  Note: Avoid using Dim.  Use Global or Local instead.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In AutoIt, a variable may be converted to an array by either using the {{Help File|ReDim}} keyword or assigning a function which returns an array to the variable.  &lt;br /&gt;
&lt;br /&gt;
For example, the function {{Help File|StringSplit}} returns an array which will be assigned to $arr.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr = StringSplit(&amp;quot;This is my string. I want to split it in sentences.&amp;quot;, &#039;.&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to make really certain we have an array from {{Help File|StringSplit}}, we should check it with the {{Help File|IsArray}} built-in function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
     ; Do work on the array&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Data to Array Elements ==&lt;br /&gt;
&lt;br /&gt;
When we declare the array we make some room in memory for future data.  We want to assign some data to the items in the array.  Now here is the catch. The array always starts at index zero.  So, the first element in the array will be accessed by zero, the second element in the array is accessed at by one and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
 Local $arr[3] ; Make room for three elements&lt;br /&gt;
 ;Assign some data&lt;br /&gt;
 $arr[0] = &amp;quot;Element 1&amp;quot;&lt;br /&gt;
 $arr[1] = &amp;quot;Element 2&amp;quot;&lt;br /&gt;
 $arr[2] = &amp;quot;Element 3&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also assign all the data in one smack like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This zero-based indexing is quite common in most computer languages, but it can be a source of headaches to beginners until it becomes second nature to them.  For example, every time you want to loop through a range of elements and the range includes the last element, you have to subtract one from the number of items your array is holding, to get the index of the last item. I.E.,  An array with three elements has a last index of two.&lt;br /&gt;
&lt;br /&gt;
So if you don&#039;t take zero-based indexing into consideration in your code, you may ask for something outside the memory area set aside for the array. When you do, you get an error message (&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Array variable has incorrect number of subscripts or subscript dimension range exceeded&amp;lt;/font&amp;gt;) and your script will cease execution.&lt;br /&gt;
&lt;br /&gt;
== Accessing Data in Arrays ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk all elements in the previous sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $arr[3] = [&amp;quot;element 1&amp;quot;, &amp;quot;element 2&amp;quot;, &amp;quot;element 3&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two.&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Determine Array Size With UBound ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;3 - 1&amp;quot; construct used in the last sample looked strange.  It is not a good idea to hard-code size like that. So lets improve our sample a little. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax = 3&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [&amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to $iMax - 1&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that&#039;s a bit cleaner. It&#039;s also a lot easier to increase or decrease the size of the array. &amp;lt;br&amp;gt;&lt;br /&gt;
But say you don&#039;t know the size of the array upfront because it may come in a variable size when created dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax &lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot; &lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered &lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then&lt;br /&gt;
     $iMax = UBound($arr); get array size&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite(&amp;quot;Items in the array: &amp;quot; &amp;amp; $iMax &amp;amp; @LF)&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error&lt;br /&gt;
         ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
     Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you run the above code you will see that $iMax is four and not three as you might have expected. The reason for this is that the developer of the {{Help File|StringSplit}} function thought it was a good idea to use the first item (item zero) to keep a count of valid items in the array. This makes sense in many situations as you now have an array containing data with an index starting at one. So our sample code can now be rewritten like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax&lt;br /&gt;
&lt;br /&gt;
Local $data = &amp;quot;Element 1|Element 2|Element 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; The string in data will be split into an array everywhere | is encountered&lt;br /&gt;
Local $arr = StringSplit($data, &amp;quot;|&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
If IsArray($arr) Then &lt;br /&gt;
    For $i = 1 to $arr[0]&lt;br /&gt;
        ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
    Next&lt;br /&gt;
EndIf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is another good reason for keeping the count in $arr[0]. When you start to use arrays extensively, you will encounter situations where you have to create an array without knowing how many of the elements you will use. Resizing the array is a relatively expensive operation (in CPU cycles) in most languages.&lt;br /&gt;
&lt;br /&gt;
Now consider our example if our initial array has reserved space for ten items but we end up only using three. In this case iterating the array using {{Help File|UBound}} will force us to check for empty elements. While iterating with $arr[0] needs no other change than maintaining the correct count in $arr[0].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;autoit&#039;&amp;gt;&lt;br /&gt;
Local $iMax=10&lt;br /&gt;
&lt;br /&gt;
;NOTE: We have added the count in the first element&lt;br /&gt;
&lt;br /&gt;
Local $arr[$iMax] = [3, &amp;quot;Element 1&amp;quot;, &amp;quot;Element 2&amp;quot;, &amp;quot;Element 3&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
;NOTE: We use the count in $arr[0] to indicate the last item and we start from index=1&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite($arr[$i] &amp;amp; @LF)&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing Array Sizes With ReDim ==&lt;br /&gt;
&lt;br /&gt;
As arrays are critical to algorithm implementations, and in AutoIt even more so as there is no other means of grouping data, we have to understand how to let it grow and shrink. This is where the keyword {{Help File|ReDim}} comes into the picture.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make an example. We want our array to hold data lines but we don&#039;t know how many items we need. We make a guess, in this case five. Now, we use that array to hold data we get from a loop with a random number of iterations. If the array is too small it should automatically be increased. Before we dump the array to output, we should adjust it to the exact size it is supposed to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $iMax = 5&lt;br /&gt;
&lt;br /&gt;
; NOTE: We have added the count in the first element&lt;br /&gt;
Local $arr[$iMax] = [0] ; Initiate the array and place a counter in the first element.&lt;br /&gt;
&lt;br /&gt;
; Generate a random number between 0 and 20&lt;br /&gt;
Local Const $iRandom = Random(0, 20, 1)&lt;br /&gt;
&lt;br /&gt;
For $i = 1 to $iRandom&lt;br /&gt;
    ; Check that the array is big enough&lt;br /&gt;
    If UBound($arr) = $i Then&lt;br /&gt;
        ; Resize the array when $i is equal to the element count in the array to prevent subscript error&lt;br /&gt;
        ReDim $arr[$arr[0] + $iMax]&lt;br /&gt;
    EndIf&lt;br /&gt;
&lt;br /&gt;
    $arr[$i] = &amp;quot;Item &amp;quot; &amp;amp; $i ; safely add data to new index element&lt;br /&gt;
&lt;br /&gt;
    $arr[0] = $i ; update the index count for future reference&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Adjust the array size. This time it is probably downward to the size of&lt;br /&gt;
; $arr[0] + 1 (remember the first item is $arr[0])&lt;br /&gt;
ReDim $arr[$arr[0] + 1] &lt;br /&gt;
&lt;br /&gt;
; Now dump the results&lt;br /&gt;
For $i = 1 to $arr[0]&lt;br /&gt;
    ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
; Visually check that the values are sound&lt;br /&gt;
ConsoleWrite(&amp;quot;Ubound($arr):=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; &amp;quot;, $iRandom:=&amp;quot; &amp;amp; $iRandom &amp;amp; @LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the array now has first been adjusted to a multiple of $iMax and in the last part adjusted down to a size matching the data items.&lt;br /&gt;
&lt;br /&gt;
== Passing Arrays to Functions ==&lt;br /&gt;
&lt;br /&gt;
There is no special syntax required to pass an array as a function argument unlike a low level language such as C.&lt;br /&gt;
The following example demonstrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array)&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can not declare the variable to hold the array in the function declaration as an array. So, users could pass on a variable. So you have to check that the variable holds an array before you do array specific operations on it.&lt;br /&gt;
The following code example will cause an error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;AutoIt&amp;quot;&amp;gt;&lt;br /&gt;
Local Const $myArray[5] = [1, 2, 3, 4, 5]&lt;br /&gt;
&lt;br /&gt;
displayArray($myArray)&lt;br /&gt;
&lt;br /&gt;
Func displayArray(Const $array[5])&lt;br /&gt;
    Local Const $arrayLength = UBound($array)&lt;br /&gt;
&lt;br /&gt;
    For $i = 0 To $arrayLength - 1&lt;br /&gt;
        MsgBox($MB_OK, &amp;quot;displayArray&amp;quot;, $array[$i])&lt;br /&gt;
    Next&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the tutorial you have probably noticed that there is a lot of code that is equal in each sample. I&#039;m especially thinking about the code we have used to output the array content. Let&#039;s make life easier and create a debug function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func dbgArray(ByRef $arr, $msg=&amp;quot;&amp;quot;)&lt;br /&gt;
     If $msg &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then &lt;br /&gt;
         ConsoleWrite(&amp;quot;*** &amp;quot; &amp;amp; $msg &amp;amp; &amp;quot; ***&amp;quot; &amp;amp; @LF)&lt;br /&gt;
     EndIf&lt;br /&gt;
&lt;br /&gt;
     For $i = 0 to UBound($arr) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i] &amp;amp;  @LF)&lt;br /&gt;
     Next&lt;br /&gt;
&lt;br /&gt;
     ConsoleWrite( &amp;quot;Ubound($arr)=:=&amp;quot; &amp;amp; UBound($arr) &amp;amp; &amp;quot;, $arr[0]:=&amp;quot; &amp;amp; $arr[0] &amp;amp; @LF)   &lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And let&#039;s make a little function to fill our arrays with something. Note how the ArrayFiller makes sure it works on an array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller(ByRef $arr)&lt;br /&gt;
     If IsArray($arr) Then &lt;br /&gt;
         ReDim $arr[3] ; Notice we might discard content in this operation&lt;br /&gt;
     Else&lt;br /&gt;
         Local $foo[3]&lt;br /&gt;
         $arr = $foo&lt;br /&gt;
     EndIf &lt;br /&gt;
&lt;br /&gt;
     ;Fill the array&lt;br /&gt;
     $arr[0] = 2&lt;br /&gt;
     $arr[1] = &amp;quot;Fill 1&amp;quot;&lt;br /&gt;
     $arr[2] = &amp;quot;Fill 2&amp;quot;&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally some code using the new functions&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr1[1]&lt;br /&gt;
   ArrayFiller($arr1)&lt;br /&gt;
   dbgArray($arr1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code is a test on what happens when we pass a regular variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
   Local $arr2&lt;br /&gt;
   ArrayFiller($arr2)&lt;br /&gt;
   dbgArray($arr2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Returning Arrays From Functions ==&lt;br /&gt;
&lt;br /&gt;
As you could observe, in the previous samples, an array will be passed back and forth with the ByRef keyword infront of the variable holding the array in the function declaration.&lt;br /&gt;
&lt;br /&gt;
We could also have used the Return keyword in a function.&lt;br /&gt;
Lets re-work the ArrayFiller function to do this rather than using a variable ByRef.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Func ArrayFiller2()&lt;br /&gt;
   Local $arr = [3, &amp;quot;Fill 1&amp;quot;, &amp;quot;Fill 2&amp;quot;]&lt;br /&gt;
   Return $arr&lt;br /&gt;
 EndFunc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And now we can use the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
 Local $foo = ArrayFiller2()&lt;br /&gt;
 dbgArray($foo)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can not compare complete arrays:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $Array1[3] = [1, 2, 3]&lt;br /&gt;
Local $Array2[3] = [1, 2, 3]&lt;br /&gt;
Local $Array3[4] = [1, 2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array2 Then ConsoleWrite(&amp;quot;1.) $Array1 is equal to $Array2! which might be correct in some sense.&amp;quot; &amp;amp; @LF); while they contain the same data, the comparison does not work.&lt;br /&gt;
&lt;br /&gt;
If $Array1 == $Array3 Then ConsoleWrite(&amp;quot;2.) $Array1 is equal to $Array3! which is incorrect.&amp;quot; &amp;amp; @LF); even though they&#039;re different in size, it&#039;s incorrectly determined that they&#039;re equal.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the impression that such comparisons compare the memory address of the arrays instead of the array elements values. And the addresses are always different for different arrays.  You have to instead, compare all elements one after the other. It might be a good idea to first compare array sizes if that can vary for both the compared arrays!&lt;br /&gt;
&lt;br /&gt;
The next example creates an array from user input and then compares elements from a 1D Array to the first column of a 2D array to return the matches as words.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; sample number string split and convert to words&lt;br /&gt;
; uncomment the ConsoleWrite and _ArrayDisplay lines to see what it does&lt;br /&gt;
;# some includes&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;# some variables&lt;br /&gt;
&lt;br /&gt;
;Create 2D array to display&lt;br /&gt;
Local $aWords[10][2] = [[0, &#039;nil&#039;] _&lt;br /&gt;
		, [1, &#039;one&#039;] _&lt;br /&gt;
		, [2, &#039;two&#039;] _&lt;br /&gt;
		, [3, &#039;three&#039;] _&lt;br /&gt;
		, [4, &#039;four&#039;] _&lt;br /&gt;
		, [5, &#039;five&#039;] _&lt;br /&gt;
		, [6, &#039;six&#039;] _&lt;br /&gt;
		, [7, &#039;seven&#039;] _&lt;br /&gt;
		, [8, &#039;eight&#039;] _&lt;br /&gt;
		, [9, &#039;nine&#039;]] ; :)&lt;br /&gt;
&lt;br /&gt;
;~ _ArrayDisplay($aWords)&lt;br /&gt;
&lt;br /&gt;
; the order of the sample digits is to show that the comparison below is accurate, from left to right&lt;br /&gt;
Local $Originalinput = InputBox(&amp;quot;Type a number&amp;quot;, &amp;quot;A number?&amp;quot;,&amp;quot;97524601&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Local $userinput = $Originalinput ; pass the orginal input to a second var&lt;br /&gt;
; now parse the userinput to that we know what was submitted, then repeat in words&lt;br /&gt;
; first strip all white space&lt;br /&gt;
$userinput = StringStripWS($userinput, 8)&lt;br /&gt;
&lt;br /&gt;
If StringIsDigit($userinput) Then ; continue&lt;br /&gt;
&lt;br /&gt;
	; now get the length of the string&lt;br /&gt;
	Local $islong = StringLen($userinput)&lt;br /&gt;
&lt;br /&gt;
	; make an array with size = length to insert items into&lt;br /&gt;
	Local $aInput[1] ; create blank one dimensional array&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; eat the string one digit at a time :)&lt;br /&gt;
	Local $oneleft&lt;br /&gt;
	For $i = 1 To $islong Step 1&lt;br /&gt;
		$oneleft = StringLeft($userinput, 1)&lt;br /&gt;
		ConsoleWrite(&amp;quot;$oneleft: &amp;quot; &amp;amp; $oneleft &amp;amp; @CRLF)&lt;br /&gt;
		$userinput = StringTrimLeft($userinput, 1) ; make the $userinput one shorter on each loop&lt;br /&gt;
		_ArrayAdd($aInput, $oneleft, 1)&lt;br /&gt;
	Next&lt;br /&gt;
;~ 	_ArrayDisplay($aInput)&lt;br /&gt;
	; now write out what the user typed in words&lt;br /&gt;
&lt;br /&gt;
;~ 	ConsoleWrite(&amp;quot;How long is the string: &amp;quot; &amp;amp; $islong &amp;amp; @CRLF)&lt;br /&gt;
; compare the user input to our defined array&lt;br /&gt;
	For $k = 0 To $islong Step 1&lt;br /&gt;
		For $j = 0 To (UBound($aWords) - 1) Step 1&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;Compare $j &amp;quot; &amp;amp; $aWords[$j][0] &amp;amp; &amp;quot; to $k &amp;quot; &amp;amp; $aInput[$k] &amp;amp; @CRLF)&lt;br /&gt;
			If $aWords[$j][0] == $aInput[$k] Then&lt;br /&gt;
				MsgBox(0, &amp;quot;Number to word&amp;quot;, $Originalinput&amp;amp;@CRLF&amp;amp;&amp;quot;User typed &amp;quot;&amp;amp; $aInput[$k]&amp;amp; @CRLF &amp;amp; $aWords[$j][1] &amp;amp; @CRLF,1)&lt;br /&gt;
			EndIf&lt;br /&gt;
;~ 			ConsoleWrite(&amp;quot;For... Next inner loops: &amp;quot; &amp;amp; $k &amp;amp; @CRLF)&lt;br /&gt;
		Next&lt;br /&gt;
;~ 		ConsoleWrite(&amp;quot;For... Next outer loops: &amp;quot; &amp;amp; $j &amp;amp; @CRLF)&lt;br /&gt;
	Next&lt;br /&gt;
&lt;br /&gt;
EndIf ; if its not digits, skip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi Dimensional Arrays ==&lt;br /&gt;
&lt;br /&gt;
Now what is a good explanation of a multi-dimensional array?&lt;br /&gt;
It could be a table where you access one item in the table at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local  $arr[3][3] = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 to UBound( $arr, 1) - 1&lt;br /&gt;
    For $j = 0 to UBound($arr, 2) - 1&lt;br /&gt;
        ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j] &amp;amp; @LF)&lt;br /&gt;
    Next &lt;br /&gt;
&lt;br /&gt;
    ConsoleWrite(@LF)&lt;br /&gt;
Next &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a number of dimensions not to exceed sixty-four as stated in the help file section [http://www.autoitscript.com/autoit3/docs/appendix/LimitsDefaults.htm AutoIt3 limits/Defaults].&lt;br /&gt;
&lt;br /&gt;
Here is a four dimensional example. You tell me how that initializer is for readability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; &lt;br /&gt;
; NOTE: The following is supposed to be all on one line&lt;br /&gt;
; but we use the &amp;quot;_&amp;quot; character to split it into multiple lines for readability&lt;br /&gt;
&lt;br /&gt;
Local $arr[3][3][3][3] = _&lt;br /&gt;
		[ _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		], _&lt;br /&gt;
		[ _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]], _&lt;br /&gt;
		[[1, 2, 3], [2, 3, 4], [3, 4, 5]] _&lt;br /&gt;
		] _&lt;br /&gt;
		]&lt;br /&gt;
&lt;br /&gt;
For $i = 0 To UBound($arr, 1) - 1&lt;br /&gt;
	For $j = 0 To UBound($arr, 2) - 1&lt;br /&gt;
		For $k = 0 To UBound($arr, 3) - 1&lt;br /&gt;
			For $l = 0 To UBound($arr, 4) - 1&lt;br /&gt;
				ConsoleWrite(&amp;quot;$arr[&amp;quot; &amp;amp; $i &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $j &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $k &amp;amp; &amp;quot;][&amp;quot; &amp;amp; $l &amp;amp; &amp;quot;]:=&amp;quot; &amp;amp; $arr[$i][$j][$k][$l] &amp;amp; @LF)&lt;br /&gt;
			Next&lt;br /&gt;
		Next&lt;br /&gt;
	Next&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(@LF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arrays in Arrays ==&lt;br /&gt;
&lt;br /&gt;
You may save an array in an array element (item). Remember that there may be issues if you pass an array containing arrays into a function and the embedded array is changed inside that function. So, as a general rule, try not to embed arrays within arrays unless you absolutely need to and are prepared to do rigorous testing to make sure your code will always work as expected.&lt;br /&gt;
&lt;br /&gt;
You can access the elements of these embedded arrays directly (note the additional () required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $aContainerArray[2]&lt;br /&gt;
Local $aInternalArray_0[2] = [&amp;quot;Internal-0-0&amp;quot;,&amp;quot;Internal-0-1&amp;quot;]&lt;br /&gt;
Local $aInternalArray_1[2] = [&amp;quot;Internal-1-0&amp;quot;,&amp;quot;Internal-1-1&amp;quot;]&lt;br /&gt;
$aContainerArray[0] = $aInternalArray_0&lt;br /&gt;
$aContainerArray[1] = $aInternalArray_1&lt;br /&gt;
&lt;br /&gt;
ConsoleWrite(&amp;quot;1 element of InternalArray_0: &amp;quot; &amp;amp; ($aContainerArray[0])[1] &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(&amp;quot;0 element of InternalArray_1: &amp;quot; &amp;amp; ($aContainerArray[1])[0] &amp;amp; @CRLF)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More Information ==&lt;br /&gt;
&lt;br /&gt;
AutoIt features a large list of [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions (UDF)], among which is a module supplying extra array functions. You can find a reference on those functions in AutoIt&#039;s Help file as the last main chapter named [http://www.autoitscript.com/autoit3/docs/libfunctions.htm User Defined Functions Reference].&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=13235</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=13235"/>
		<updated>2015-09-15T15:54:26Z</updated>

		<summary type="html">&lt;p&gt;Skysnake: /* Databases and web connections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&lt;br /&gt;
This list is probably not complete (245 UDFs on 2015/08/16), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [http://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory. Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - The same as above for Google Chrome. Automate the most common tasks in Chrome with the Chrome UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile, the application searches for the profile in home drive, That will be the one to backup.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/124330-_htmlau3-v101/ _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - Everything about Internet explorer can be automated with the IE library supplied with a standard AutoIt install.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - The same as above for Opera. Automate the most common tasks in Opera with the Opera UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (by water)] - Automate Microsoft Outlook. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF.&lt;br /&gt;
&lt;br /&gt;
== Databases and web connections ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by oriz)] - EzMySql - Use MySql Databases with autoit.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/94920-solved-passing-parameters-using-dllcall-to-a-c-dll/?do=findComment&amp;amp;comment=684751 FireBird (by eltorro)] - FireBird, Interbase dll udf.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL.au3. ADODB Connection.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/122360-mysql-odbc-connector-udf MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/173984-the-combination-of-autoit-php-and-mysql/ AutoIt PHP MySQL (by J2TeaM)] - The combination of AutoIt, PHP and MySQL.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=112273 LZMA Compression (by Ward)] - LZMA Compression UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166634 MessagePack (by Ward)] - MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it&#039;s faster and smaller.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP.au3 UDF in pure AutoIt.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=128962 zLib (by Ward)] - zLib (Deflate/Inflate/GZIP) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=78745 AES Rijndael (by Ward)] - Very fast AES UDF. Support ECB/CBC/CFB/OFB block cipher mode.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=76976 MD5,SHA1,CRC32,RC4,BASE64,XXTEA (by Ward)] - Several encryption and hash functions.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp.au3 (by Yashied)] - Management of context help ([http://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=113723 Easy Scrollbars (by Melba23)] - Easily create scrollable sections in your GUI.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([http://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - A library that allows a user to skin their application GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - A large library that allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your gui.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=143711 Marquees (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [[CommAPI]] (by therealhanuta) - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/158640-spi-hardware-interface SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [http://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/173067-curl-udf-autoit-binary-code-version-of-libcurl-with-ssl-support/ cURL (by Ward)] - AutoIt binary code version of libcurl with SSL support.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - UDF to generate JSON.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=167339 _POP3_Ex (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=64051 POP3 SSL (by Fox2)] - A POP3 library that&#039;s compatible with Gmail. It uses an external executable that must be supplied with your script.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/173129-request-udf-the-simplest-way-to-make-http-request Request (by Ward)] - Powerful and easy-to-use HTTP client for AutoIt based on Curl.au3 and Json.au3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - This is an UDF full of advanced mathematical functions. It allows to work with primes, create number sequences, interpolate, calculate values of functions like Riemann zeta.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/94770-integer-to-roman-numerals/#entry1043544 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometry math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - RTF_Printer.au3 - Printing RichEdit in the background.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [http://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Another UDF bringing Irrlicht and au3 together. Historically some kind of a follower of the UDF above, technically with a complete different approach.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - This is an UDF for reading info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files UDF also retreive various Exif information.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - new set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - UDF for libZPlay - multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - UDF using the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [http://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - With this UDF you can simply update your no-ip hostname(s) and retrive the ip address of an no-ip address.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166205 TeamViewer API (by mLipok)] - UDF for TeamViewer API - a modest beginning.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Twitter UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - YWeather UDF - Yahoo Weather API.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - FileSystemMonitor UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Windows Firewall UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Local account UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - This UDF exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/164756-sccm-udf/ SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173934 TTS UDF (by Kanashius)] - UDF for use with SAPI Automation Object - text-to-speech (TTS) engine&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - A UDF for manipulating Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Android UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store strings locally (at program level) or globally (at OS level) with unique numerical identifiers. This UDF lets you add, find, delete, and query these atoms.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=131037 Binary (by Ward)] - Binary UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=162366 BinaryCall (by Ward)] - BinaryCall UDF - Write Subroutines In C, Call In AutoIt.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - With DDEML UDF one can use an AutoIt script as a DDE client or server.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=111613 FASM (by Ward)] - The Embedded Flat Assembler (FASM) UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - _FileGetMimeType UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/117033-file-locking-with-cooperative-semaphores File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=90492 Hotkey.au3 (by Yashied)] - Management of Hotkeys UDF, with several advantages over HotkeySet().&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=86672 Inline Assembly (by Ward)] - Assembles the code to binary machine code and runs it.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - LFN UDF - overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - This is the Inline UDF for an Assembler&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=77463 MemoryDll (by Ward)] - Embed DLLs in script and call functions from memory.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes which spoil the look of your GUI.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - NotifyIcon UDF (formerly TrayIconEx) - Create, delete and manage self notify icons.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from Memory UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Resources UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - ResourcesEx UDF (up to date with the current AutoIt language syntax v3.3.12.0).&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker UDF - Hunspell.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - UDF for users of Synology NAS server.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - TVExplorer UDF.&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - SciLexer UDF.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>Skysnake</name></author>
	</entry>
</feed>