# Script Breaking Changes in Recent Versions

This page contains a list of all changes made in recent updates that will almost certainly break existing scripts. Please read this list carefully when upgrading if you have not been keeping up with developments in the beta versions. If any of these issues affect you then you will need to modify your scripts.

## v3.3.16.0

UDFs:

- ColorConstants.au3 has been adapted to fit W3C Colors. So MAROON, SKYBLUE have different values, CREAM, MEDBLUE, MDGRAY,MONEYGREEN have been removed.
- SecurityConstants.au3 has been adapted to avoid naming conflicts. So $RIGHTS_DELETE, $SYNCHRONIZE, have been renamed to $STANDARD_*.

## v3.3.14.3

UDFs:

- _MathCheckDiv() documentation has been removed. The function is still present in Math.au3, but may be removed at a later date. Scripts should be updated to use Mod() instead.
- On error value of both _Degree() and _Radian(), has been changed from an empty string to 0.
- _WinAPI_DefSubclassProc(), _WinAPI_GetWindowSubclass(), _WinAPI_RemoveWindowSubclass() and _WinAPI_SetWindowSubclass() moved from WinAPIShellEx.au3 to WinAPISys.au3.
- Fixed typo in AutoItConstants.au3 ( $EXITCLOSE_BYSUTDOWN > $EXITCLOSE_BYSHUTDOWN ) which was used with OnAutoItExitRegister().
- WinAPI_GetOPenFileName(), _WinAPI_GetSaveFileName() returns file with extension only if typed.

## v3.3.14.2

UDFs:

- _SQLite_Startup() function no longer automatically downloads the SQLite DLL files from autoitscript.com. Most users were completely unaware that this download was occuring on each script run and it was also a severe bandwidth hog for the website. The SQLite DLLs must now be downloaded manually. See the _SQLite_Startup() documentation for details.

## v3.3.14.0

AutoIt:

- If Min and Max are the same value then Random() will now return that value and the @error flag will no longer be set.
- Under Vista or Server 2008 _GDIPlus_Startup() need explicit Dll for GDI+ v1.1 support.
- File operations on text files not opened with FileOpen() and explicit unicode flags now auto-detect encoding slightly differently to be more in line with modern editors. This includes all file functions that are used with a filename, for example FileRead("filename.txt"). Specifically:

- Files containing a BOM will be opened in the relevant mode as per that BOM. UTF-8 and UTF-16 BOMs are checked.
- UTF-8 and UTF-16 files without a BOM will be automatically detected and opened in the relevant mode.
- Files containing nulls are opened in Binary ($FO_BINARY) mode by default (unless they are detected as valid UTF-16). Previously they would be opened in ANSI mode. Use the $FO_ANSI flag to override.
- Files containing only characters 1-127 are opened in UTF-8 with no BOM ($FO_UTF8_NOBOM) mode by default. Previously they would be opened in ANSI mode. Use the $FO_ANSI flag to override.
- Files containing only characters 1-255 are opened in ANSI ($FO_ANSI) mode by default.
- Due to the above FileGetEncoding() now returns 512 ($FO_ANSI) or 256 ($FO_UTF8_NOBOM) instead of 0 which was undocumented but indicated ANSI.

- New files are written in UTF-8 with no BOM ($FO_UTF8_NOBOM) mode by default. Use FileOpen() to override.
- UTF-16 files without a BOM are now automatically detected in most cases.

UDFs:

- Excel UDF, function _Excel_BookOpen: When parameter $bReadOnly = False and read-write access could not be granted @error was set to 4 and the Workbook was opened read-only. Now @error = 0, @extended = 1 and the Workbook is opened read-only.
- Word UDF, function _Word_DocOpen: When parameter $bReadOnly = False and read-write access could not be granted @error was set to 4 and the document was opened read-only. Now @error = 0, @extended = 1 and the document is opened read-only.

## v3.3.12.0

UDFs:

- The parameter $hPrintCallback (formerly $sPrintCallback) in _SQLite_Startup() now requires a function object rather than a function string. This is due to the usage of Call() being removed from the UDF.
- The parameter $hFunctionCall (formerly $sFunctionCall) in _FTP_ProgressDownload() and _FTP_ProgressUpload() now requires a function object rather than a function string. This is due to the usage of Call() being removed from the UDF.
- _ArrayDelete() sets @error to non-zero if $iElement is out of bounds. Please see documentation for more details.
- _StringBetween() change in behaviour and parameter order change. Please see documentation for more details.
- _GUICtrlListView_GetView() and _GUICtrlListView_SetView() were using 0 for detailed view and 1 for large icon view, when it's 0 for large icon view and 1 for detailed view.
- Array UDF was re-written. Functions and/or parameters have been changed, removed or added. A detailed list can be found here.
- Excel UDF was re-written. Functions and/or parameters have been renamed, removed or added. A detailed list can be found here.

Missing information from the v3.3.10.0 notes:

- _ArrayDisplay() re-written with additional parameters. Please see documentation for more details.

## v3.3.10.1

UDFs:

Missing information from the v3.3.10.0 notes:

- $tagBITMAPINFO fields changed by using the prefix of "bi".

## v3.3.10.0

AutoIt:

- The return value of ShellExecute() has now changed. Instead of returning 1, it returns the PID of the executed process or -1 if no PID exists.

UDFs:

- _Iif() documentation has been removed. The function is still present in Misc.au3, but may be removed at a later date. Scripts should be updated to use ternary operators instead.
- _IEErrorHandlerRegister() has been removed. It's not required due to COM errors no longer being fatal.
- _StringEncrypt() documentation has been removed. The function is still present in String.au3, but may be removed at a later date. Scripts should be updated to use the Crypt functions instead.
  Look at _Crypt_EncryptData() for an example of an alternative _StringEncrypt.
- _StringReverse() documentation has been removed. The function is still present in String.au3, but may be removed at a later date. Scripts should be updated to use the native function StringReverse() instead.
- With the introduction of WinAPIEx functions some constants of Constants.au3 include file have been moved to WinAPIConstants.au3.
- Word UDF was re-written. Functions and/or parameters have been renamed, removed or added. A detailed list can be found here.
- $tagGDIPPENCODERPARAMS removed, use $tagGDIPENCODERPARAMS.
- $tagGDIPENCODERPARAMS use $tagGDIPENCODERPARAM as a first structure of the array.
- $tagGDIPENCODERPARAM "count" field renamed in "nbOfValues".
- $tagBITMAPINFO fields changed by using the prefix of "bi".
- _ArrayUnique() re-written with improved speed. The final parameter is used to select whether to return count of returned strings in $aArray[0]
- ToolTip UDF was re-written. Functions and/or parameters have been renamed, removed or added. A detailed list can be found here.
- _ArrayDisplay() re-written with additional parameters. Please see documentation for more details.

## v3.3.8.0

AutoIt:

- ObjName() has had a number of bug fixes and changes that may affect data returned. Built-in UDFs have been changed to accommodate this but custom scripts may need to be edited.
- ObjEvent() AutoIt.Error objects no longer have Raise() or Clear() methods and the properties are read-only.
- Int() and Hex() no longer set @error.
- COM methods now require parenthesis so the language can internally detect properties versus methods easier.

## v3.3.6.0

UDFs:

- _DateToDayOfWeekISO returned 0-6 and is changed to 1-7 where Monday = 1.

## v3.3.4.0

Some of the following features are deprecated. Deprecated features are no longer documented but continue to work. Deprecated features will be removed after version 3.3.4.0. It is strongly recommended that scripts relying on deprecated features be updated to work with the new behavior. Some features have already been removed and will be noted as such.

AutoIt:

- The raw reading mode for FileOpen() has been removed.
- InetGet("abort"), @InetGetActive and @InetGetBytesRead have been removed. The following list shows the new functions used to access the old behavior:
- - InetGet("abort") - Calling the new InetClose() function with a handle returned from InetGet() will abort a download.
  - @InetGetActive - Calling the new InetGetInfo() function with no parameters returns a count of active downloads.
  - @InetGetBytesRead - Calling the new InetGetInfo() function with a handle returned from InetGet()will return the bytes read (and more) for a download.
- AdlibEnable() and AdlibDisable() have been removed. See the new functions AdlibRegister() and AdlibUnRegister().
- OnAutoItStart() has been removed. See the new pre-processor statement #OnAutoItStartRegister.
- OnAutoItExit() has been removed. See the new functions OnAutoItExitRegister() and OnAutoItExitUnRegister().

## v3.3.2.0

Some of the following features are deprecated. Deprecated features are no longer documented but continue to work. Deprecated features will be removed after version 3.3.2.0. It is strongly recommended that scripts relying on deprecated features be updated to work with the new behavior. Some features have already been removed and will be noted as such.

AutoIt:

- ShellExecute() and ShellExecuteWait() no longer use the "open" verb by default. See the remarks section for those functions for more details.
- The return value of InetGet() has changed. It is important to read and understand the changes because it is possible to leak resources if InetGet() is used incorrectly.
- InetGet("abort"), @InetGetActive and @InetGetBytesRead are now deprecated. The following list shows the new functions used to access the old behavior:
- - InetGet("abort") - Calling the new InetClose() function with a handle returned from InetGet() will abort a download.
  - @InetGetActive - Calling the new InetGetInfo() function with no parameters returns a count of active downloads.
  - @InetGetBytesRead - Calling the new InetGetInfo() function with a handle returned from InetGet()will return the bytes read (and more) for a download.
- The FtpBinaryMode option set with AutoItSetOption() has been removed. Now InetGet() takes a flag to specify the transfer mode.
- The URLDownloadToFile() alias for InetGet() has been removed.
- AdlibEnable() and AdlibDisable() are deprecated. See the new functions AdlibRegister() and AdlibUnRegister().
- OnAutoItStart() is deprecated. See the new pre-processor statement #OnAutoItStartRegister.
- OnAutoItExit() is deprecated. See the new functions OnAutoItExitRegister() and OnAutoItExitUnRegister().
- The AutoItSetOption() option OnExitFunc has been removed. See the new functions OnAutoItExitRegister() and OnAutoItExitUnRegister().
- GUICreate() with $WS_EX_MDICHILD has been fixed to be relative to client area as documented.
- ProcessWait() now returns a PID instead of 1 on success.
- WinWait(), WinWaitActive(), WinActivate(), WinActive() and WinMove() now return an HWND instead of 1 on success.
- The macro @YDAY now uses the range 001 - 366 instead of 1 - 366. This makes the macro more consistent with other languages (like C/C++) and more consistent with all other date related macros which return strings with leading 0s to pad the length.
- RegEnumKey() and RegEnumVal() now return an empty string instead of an error message.

UDFs:

- The last optional parameter for _StringBetween() has been removed.
- _StringAddThousandsSep() has been removed. There are too many opinions on what this function should do and too many revisions of this function have been made.
- _SQLite_SaveMode() has been renamed to _SQLite_SafeMode().

## v3.3.0.0

AutoIt:

- Windows 9x and Windows NT 4.0 Operating System support has been removed. Use v3.2.12.1 of AutoIt if you really need this.
- @ProcessorArch changed to @OSArch as it was misleading.
- RegRead() and RegWrite() no longer use hex strings for REG_BINARY types - native binary datatypes are enforced.

AutoItX:

- The native version of the DLL now exclusively uses Unicode strings (LPWSTR and LPCWTSR). If you really need ANSI strings then continue to use v3.2.12.1. The easiest workaround though is to use a "wrapper" function to simply convert between Unicode and ANSI. A limited selection of functions (WinWait... and Send) have an ANSI version but it is not intended to add ANSI versions for any others unless there is a large demand.

## v3.2.12.0

AutoIt:

- RunAsSet() has been removed. Use the new RunAs() and RunAsWait() functions instead. They have been enhanced with slightly better security (It is still not recommended to store important passwords in your scripts) and more functionality.
- The option RunErrorsFatal has been removed. Run(), RunWait(), ShellExecute() and ShellExecuteWait() now all set @error when they fail to run the application. AutoIt will no longer throw a fatal error when an application fails to run.
- StdoutRead(), StderrRead() and ConsoleRead() have undergone significant changes. They no longer block, they return immediately. The parameters have changed as well. It's no longer possible to read count parameters. The peek parameter has moved to the second parameter. The third parameter now specifies you want the data to be returned in binary format (default is text). The macro @extended now holds the number of bytes/characters read.
- StdinWrite(), ConsoleWrite() and ConsoleWriteError() will now behave differently when given binary data. The binary data is written as-is instead of converting it to a string. Also, the return value from these functions is the number of bytes written instead of a generic value of 1.
- Removed: ColorMode option ( Opt() ).
- Fixed: Random(Min,Max,1). Previously this would never actually return Max, so if Max was artificially incremented by one the script will now need to be changed.

UDFs:

- (Please see this forum thread for more details and help with these changes.)
- GUIConstants.au3 is identical to GUIConstantsEx.au3. This means that many scripts using advanced GUI functionality will need to use additional #include statements to include files containing constants that were previously and erroneously included.
- GUIDefaultConstants.au3 no longer exists. You must now #include the corresponding individual constants file for the control type you need. For example, ListBoxConstants.au3, ComboConstants.au3, EditConstants.au3, etc.
- _ArrayCreate() documentation has been removed. The function is still present but may be removed at a later time. Scripts should be updated to use the array initialization syntax built into AutoIt.

## v3.2.10.0

AutoIt

- DllCall(): short_ptr, long_ptr, int_ptr types deprecated. Use short*, long* and int* respectively.

UDFs

- _GUICtrlXXXYYY() have been renamed _GUICtrlXXX_YYY() without any functional changes.