guinness Posted July 1, 2013 Author Share Posted July 1, 2013 Is this a better example to what I suggested in post >#297? The idea of what the functions do is really not the point I'm making, it's the concept and design I'm interested in. expandcollapse popup#include <Array.au3> #include <Constants.au3> ; This enumeration starts from 0 to 3. Global Enum $AU3SCRIPT_FILEPATH, $AU3SCRIPT_FILEDATA, $AU3SCRIPT_FUNCTIONS, $AU3SCRIPT_MAX ; These could be inside the functions as Local Enum if you don't want Global variables. Example() Func Example() ; Create a constant variable with the filepath we wish to pass to Au3Script_Start. Local Const $sFilePath = @ScriptFullPath ; Create an "Au3Script" object/api to pass to functions that can manipulate with this variable only. Local $hAu3Script = Au3Script_Start($sFilePath) ; Read and display function(s) in the script file. Local $aFunctions = Au3Script_Functions($hAu3Script) _ArrayDisplay($aFunctions, 'Functions') ; Read and display the script file data. Local $sData = Au3Script_Read($hAu3Script) MsgBox($MB_SYSTEMMODAL, '', $sData) ; Display the object/api to show it is indeed an array. Item 2 is blank as this is an array. ; Note: The end-user shouldn't really see this, but this is purely for demonstration purposes. _ArrayDisplay($hAu3Script, 'INTERNAL_ONLY') ; Clear the object/api. Au3Script_Shutdown($hAu3Script) EndFunc ;==>Example Func Au3Script_Functions(ByRef $aAPI) ; Display function(s) in a script file. Local $aFunctions = 0 If __Au3Script_IsObject($aAPI) Then ; Check if the variable passed is a valid array with the correct number of dimensions. If UBound($aAPI[$AU3SCRIPT_FUNCTIONS]) = 0 Then ; Check if the variable is not an array already. $aFunctions = StringRegExp('Func Count(' & @CRLF & $aAPI[$AU3SCRIPT_FILEDATA], '(?im)^Func\h+(\w+)\h*\(', 3) ; Retrieve function(s) in the script. $aFunctions[0] = UBound($aFunctions) - 1 ; Set the 0th index to the total count. $aAPI[$AU3SCRIPT_FUNCTIONS] = $aFunctions ; Assign the object/api "function" with the function(s) array. Else $aFunctions = $aAPI[$AU3SCRIPT_FUNCTIONS] ; If the object/api "function" is already an array, then assign the return variable with that function. EndIf EndIf Return $aFunctions EndFunc ;==>Au3Script_Functions Func Au3Script_Read(ByRef $aAPI) ; Read a script file. Local $sFileData = '' If __Au3Script_IsObject($aAPI) Then ; Check if the variable passed is a valid array with the correct number of dimensions. If $aAPI[$AU3SCRIPT_FILEDATA] = '' Then ; Check if the variable is blank/empty. $aAPI[$AU3SCRIPT_FILEDATA] = FileRead($aAPI[$AU3SCRIPT_FILEPATH]) ; Assign the object/api "data" with the script file data. EndIf $sFileData = $aAPI[$AU3SCRIPT_FILEDATA] ; Assign the return variable with the the object/api "data" content. EndIf Return $sFileData ; Return the read data. EndFunc ;==>Au3Script_Read Func Au3Script_Start($sFilePath) Local $aAPI[$AU3SCRIPT_MAX] ; Create an array with 3 elements. $aAPI[$AU3SCRIPT_FILEPATH] = $sFilePath ; Assign the object/api "filepath" with the script file path. Au3Script_Read($aAPI) ; Read the script file using the Au3Script_Read function. Return $aAPI ; Return the newly created object/api handle. EndFunc ;==>Au3Script_Start Func Au3Script_Shutdown(ByRef $aAPI) Local $fReturn = __Au3Script_IsObject($aAPI) ; Check if the variable passed is a valid array with the correct number of dimensions. If $fReturn Then ; If is an object/api then continue... $aAPI = 0 ; Clear the array of all data. EndIf Return $fReturn ; True or False depending on the return value of __Au3Script_IsObject. EndFunc ;==>Au3Script_Shutdown Func __Au3Script_IsObject(ByRef $aAPI) ; Internal function to check if the number of items is equal to 3 or the enum variable $AU3SCRIPT_MAX. Return UBound($aAPI) = $AU3SCRIPT_MAX EndFunc ;==>__Au3Script_IsObject mLipok 1 UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Mat Posted July 1, 2013 Share Posted July 1, 2013 Is this a better example to what I suggested in post >#297? The idea of what the functions do is really not the point I'm making, it's the concept and design I'm interested in. expandcollapse popup#include <Array.au3> #include <Constants.au3> ; This enumeration starts from 0 to 3. Global Enum $AU3SCRIPT_FILEPATH, $AU3SCRIPT_FILEDATA, $AU3SCRIPT_FUNCTIONS, $AU3SCRIPT_MAX ; These could be inside the functions as Local Enum if you don't want Global variables. Example() Func Example() ; Create a constant variable with the filepath we wish to pass to Au3Script_Start. Local Const $sFilePath = @ScriptFullPath ; Create an "Au3Script" object/api to pass to functions that can manipulate with this variable only. Local $hAu3Script = Au3Script_Start($sFilePath) ; Read and display function(s) in the script file. Local $aFunctions = Au3Script_Functions($hAu3Script) _ArrayDisplay($aFunctions, 'Functions') ; Read and display the script file data. Local $sData = Au3Script_Read($hAu3Script) MsgBox($MB_SYSTEMMODAL, '', $sData) ; Display the object/api to show it is indeed an array. Item 2 is blank as this is an array. ; Note: The end-user shouldn't really see this, but this is purely for demonstration purposes. _ArrayDisplay($hAu3Script, 'INTERNAL_ONLY') ; Clear the object/api. Au3Script_Shutdown($hAu3Script) EndFunc ;==>Example Func Au3Script_Functions(ByRef $aAPI) ; Display function(s) in a script file. Local $aFunctions = 0 If __Au3Script_IsObject($aAPI) Then ; Check if the variable passed is a valid array with the correct number of dimensions. If UBound($aAPI[$AU3SCRIPT_FUNCTIONS]) = 0 Then ; Check if the variable is not an array already. $aFunctions = StringRegExp('Func Count(' & @CRLF & $aAPI[$AU3SCRIPT_FILEDATA], '(?im)^Func\h+(\w+)\h*\(', 3) ; Retrieve function(s) in the script. $aFunctions[0] = UBound($aFunctions) - 1 ; Set the 0th index to the total count. $aAPI[$AU3SCRIPT_FUNCTIONS] = $aFunctions ; Assign the object/api "function" with the function(s) array. Else $aFunctions = $aAPI[$AU3SCRIPT_FUNCTIONS] ; If the object/api "function" is already an array, then assign the return variable with that function. EndIf EndIf Return $aFunctions EndFunc ;==>Au3Script_Functions Func Au3Script_Read(ByRef $aAPI) ; Read a script file. Local $sFileData = '' If __Au3Script_IsObject($aAPI) Then ; Check if the variable passed is a valid array with the correct number of dimensions. If $aAPI[$AU3SCRIPT_FILEDATA] = '' Then ; Check if the variable is blank/empty. $aAPI[$AU3SCRIPT_FILEDATA] = FileRead($aAPI[$AU3SCRIPT_FILEPATH]) ; Assign the object/api "data" with the script file data. EndIf $sFileData = $aAPI[$AU3SCRIPT_FILEDATA] ; Assign the return variable with the the object/api "data" content. EndIf Return $sFileData ; Return the read data. EndFunc ;==>Au3Script_Read Func Au3Script_Start($sFilePath) Local $aAPI[$AU3SCRIPT_MAX] ; Create an array with 3 elements. $aAPI[$AU3SCRIPT_FILEPATH] = $sFilePath ; Assign the object/api "filepath" with the script file path. Au3Script_Read($aAPI) ; Read the script file using the Au3Script_Read function. Return $aAPI ; Return the newly created object/api handle. EndFunc ;==>Au3Script_Start Func Au3Script_Shutdown(ByRef $aAPI) Local $fReturn = __Au3Script_IsObject($aAPI) ; Check if the variable passed is a valid array with the correct number of dimensions. If $fReturn Then ; If is an object/api then continue... $aAPI = 0 ; Clear the array of all data. EndIf Return $fReturn ; True or False depending on the return value of __Au3Script_IsObject. EndFunc ;==>Au3Script_Shutdown Func __Au3Script_IsObject(ByRef $aAPI) ; Internal function to check if the number of items is equal to 3 or the enum variable $AU3SCRIPT_MAX. Return UBound($aAPI) = $AU3SCRIPT_MAX EndFunc ;==>__Au3Script_IsObject Yes. DRY is quite important: In multiple places you are defining the same constants (I see Local/Global enum as constants). The new design is very easy to add a new element to. AutoIt Project Listing Link to comment Share on other sites More sharing options...
guinness Posted July 2, 2013 Author Share Posted July 2, 2013 Thanks. If one person learns something then I will be happy. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Ascend4nt Posted July 17, 2013 Share Posted July 17, 2013 So I've been experimenting with how/where to put structure 'tag' strings that are generally only used by one function. I've been using 'Local Const' to define them, but remembered that AutoIt reinterprets everything each time it enters a function, so I figured why not put it as 'Static Local Const', but then hmm.. can't make something Const as well as Static (language defect). So I figured, wth, I'll just obey Const rules.. Anyway, I'm curious to see what other people would think is proper here. Too many Global variables take up the global namespace, and if they are only really relevant to a particular function, why put it outside of that function? I did some timing tests to see what the difference in time would be in declaring something Global vs. Local Const vs. Static Local, and it appears Global and Static Local are pretty close to one another in speed. It might not be pretty but it keeps things packaged inside a function. Here's an example (I renamed the Global by 1 letter to prevent conflict): expandcollapse popupGlobal Const $tafPROCESS_PARAMETERS="ulong MaxLen;ulong Length;ulong Flags;ulong DebugFlags;ptr ConsoleHandle;ulong ConsoleFlags;"& _ "ptr StandardInput;ptr StandardOutput;ptr StandardErr;ushort CurrentDirLen;ushort CurrentDirMaxLen;ptr CurrentDir;ptr CurDirHandle;" & _ "ushort DLLSearchPathLen;ushort DLLSearchPathMaxLen;ptr DLLSearchPath;ushort ImagePathLen;ushort ImagePathMaxLen;ptr ImagePathName;" & _ "ushort CommandLineLen;ushort CommandLineMaxLen;ptr CommandLine;ptr Environment;ulong StartingX;ulong StartingY;" & _ "ulong CountX;ulong CountY;ulong CountCharsX;ulong CountCharsY;ulong FillAttribute;ulong WindowFlags;ulong_ptr ShowWindowFlags;" & _ "ushort InvokeMethodLen;ushort InvokeMethodMaxLen;ptr InvokeMethod;ushort DesktopInfoLen;ushort DesktopInfoMaxLen;ptr DesktopInfo;" & _ "ushort ShellInfoLen;ushort ShellInfoMaxLen;ptr ShellInfo;ushort RuntimeDataLen;ushort RuntimeDataMaxLen;ptr RuntimeData" Func Test1() Local Const $tagPROCESS_PARAMETERS="ulong MaxLen;ulong Length;ulong Flags;ulong DebugFlags;ptr ConsoleHandle;ulong ConsoleFlags;"& _ "ptr StandardInput;ptr StandardOutput;ptr StandardErr;ushort CurrentDirLen;ushort CurrentDirMaxLen;ptr CurrentDir;ptr CurDirHandle;" & _ "ushort DLLSearchPathLen;ushort DLLSearchPathMaxLen;ptr DLLSearchPath;ushort ImagePathLen;ushort ImagePathMaxLen;ptr ImagePathName;" & _ "ushort CommandLineLen;ushort CommandLineMaxLen;ptr CommandLine;ptr Environment;ulong StartingX;ulong StartingY;" & _ "ulong CountX;ulong CountY;ulong CountCharsX;ulong CountCharsY;ulong FillAttribute;ulong WindowFlags;ulong_ptr ShowWindowFlags;" & _ "ushort InvokeMethodLen;ushort InvokeMethodMaxLen;ptr InvokeMethod;ushort DesktopInfoLen;ushort DesktopInfoMaxLen;ptr DesktopInfo;" & _ "ushort ShellInfoLen;ushort ShellInfoMaxLen;ptr ShellInfo;ushort RuntimeDataLen;ushort RuntimeDataMaxLen;ptr RuntimeData" DllStructCreate($tagPROCESS_PARAMETERS) Return 0 EndFunc Func Test2() Static Local $tagPROCESS_PARAMETERS="ulong MaxLen;ulong Length;ulong Flags;ulong DebugFlags;ptr ConsoleHandle;ulong ConsoleFlags;"& _ "ptr StandardInput;ptr StandardOutput;ptr StandardErr;ushort CurrentDirLen;ushort CurrentDirMaxLen;ptr CurrentDir;ptr CurDirHandle;" & _ "ushort DLLSearchPathLen;ushort DLLSearchPathMaxLen;ptr DLLSearchPath;ushort ImagePathLen;ushort ImagePathMaxLen;ptr ImagePathName;" & _ "ushort CommandLineLen;ushort CommandLineMaxLen;ptr CommandLine;ptr Environment;ulong StartingX;ulong StartingY;" & _ "ulong CountX;ulong CountY;ulong CountCharsX;ulong CountCharsY;ulong FillAttribute;ulong WindowFlags;ulong_ptr ShowWindowFlags;" & _ "ushort InvokeMethodLen;ushort InvokeMethodMaxLen;ptr InvokeMethod;ushort DesktopInfoLen;ushort DesktopInfoMaxLen;ptr DesktopInfo;" & _ "ushort ShellInfoLen;ushort ShellInfoMaxLen;ptr ShellInfo;ushort RuntimeDataLen;ushort RuntimeDataMaxLen;ptr RuntimeData" DllStructCreate($tagPROCESS_PARAMETERS) Return 0 EndFunc Func Test3() DllStructCreate($tafPROCESS_PARAMETERS) Return 0 EndFunc $iTimer = TimerInit() For $i=1 To 10000 Test1() Next ConsoleWrite("Test1() [Local Const] results = " & TimerDiff($iTimer) & " ms"&@CRLF) $iTimer = TimerInit() For $i=1 To 10000 Test2() Next ConsoleWrite("Test2() [Static Local] results = " & TimerDiff($iTimer) & " ms"&@CRLF) $iTimer = TimerInit() For $i=1 To 10000 Test3() Next ConsoleWrite("Test3() [Global Const] results = " & TimerDiff($iTimer) & " ms"&@CRLF) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
guinness Posted July 17, 2013 Author Share Posted July 17, 2013 (edited) v3.3.8.1 Test1() [Local Const] results = 704.634111412033 msTest2() [static Local] results = 646.790688080816 msTest3() [Global Const] results = 622.18777997563 msv3.3.9.7 Test1() [Local Const] results = 754.285200375183 msTest2() [static Local] results = 729.205738006596 msTest3() [Global Const] results = 699.088974880458 ms Edited September 4, 2015 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Ascend4nt Posted July 17, 2013 Share Posted July 17, 2013 So, what you're saying is that you prefer tap over bottled? Interesting viewpoint on the matter My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
guinness Posted July 17, 2013 Author Share Posted July 17, 2013 Well bottled water is just tap water in some cases, so yeah, I like good old fashioned tap water. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Mat Posted July 17, 2013 Share Posted July 17, 2013 Where I live the tap water doesn't even need to be filtered to be drinkable (and good as well). As a result, any bottled water is likely to be less healthy than what we get out of the tap. AutoIt Project Listing Link to comment Share on other sites More sharing options...
jaberwacky Posted July 31, 2013 Share Posted July 31, 2013 (edited) Ok, so I have a theory that using ByRef is a good coding practice. Let's discuss why I'm wrong. This demonstrates my justification for using ByRef on strings and arrays (really, all variables). Is this not good practice then? ; creates a variable in memory which has a lot of elements Global Const $my_global_variable[16777216] = [''] MyFunction($my_global_variable) ; creates yet another variable in memory which has a lot of elements Func MyFunction(const $my_local_variable) ; crunch $my_local_variable EndFunc ; creates a pointer in memory which still uses memory yes, ; but if $my_global_variable were huge ; then it would save memory Func MyFunctionWithByRef(const byref $my_local_variable) ; crunch on $my_local_variable EndFunc Edited July 31, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
guinness Posted July 31, 2013 Author Share Posted July 31, 2013 It really depends on the datatype being 'referenced' and whether you need the data remaining the same when you return from the function. You're saying that you use ByRef religiously, which isn't always a good thing. Take for example the following: Local $sFilePath = @ScriptDir SomeFilePath($sFilePath) ConsoleWrite('Outside of function: ' & $sFilePath & @CRLF ) ; This should be exactly the same as when first initialised, but using ByRef changes the data in the variable. Func SomeFilePath(ByRef $sFilePath) If Not (StringRight($sFilePath, StringLen('\')) = '\') Then $sFilePath &= '\' ; Append a backslash for the purposes of this function only. ConsoleWrite('SomeFilePath: ' & $sFilePath & @CRLF) EndFunc ;==>SomeFilePath So you might be saving on "memory" but causing even more problems later on. As I mentioned before arrays and strings are copy-on-write, so if you pass an array via a function, AutoIt doesn't copy the variable data unless it's changed in someway. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted July 31, 2013 Author Share Posted July 31, 2013 SomeFunc('FILEPATH') Func SomeFunc($sFilePath) Return $sFilePath EndFunc ;==>SomeFunc ; Is no different to... $sFilePath = 'FILEPATH' Func SomeFunc(ByRef Const $sFilePath) Return $sFilePath EndFunc ;==>SomeFunc ; as a single variable has to be created anyway. So it's kind of defeating the whole purpose. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
jaberwacky Posted July 31, 2013 Share Posted July 31, 2013 I personally do not like to modify variables ByRef. Take _ArrayDelete for example. Because it doesn't return a modified array then I have to feed it a non const array. This goes against established best coding practice. I love my const variables. But I can see what you mean by your example though I still think it duplicates the variable if it isn't passed ByRef. Which could have problems for large arrays/strings. ; as a single variable has to be created anyway. So it's kind of defeating the whole purpose. See the comment I added: SomeFunc('FILEPATH') Func SomeFunc($sFilePath) Return $sFilePath ; my argument is that two variables are created here whereas if it were byref then only one is created. EndFunc ;==>SomeFunc Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
MHz Posted July 31, 2013 Share Posted July 31, 2013 I did up a page here on variables and functions and the so called memory usage of them. It focuses on the effect of copy-on-write. Try this test script and see if changes your view about ByRef usage. jaberwacky 1 Link to comment Share on other sites More sharing options...
AZJIO Posted July 31, 2013 Share Posted July 31, 2013 Global Const $aArr[1] = [1] $aArr0 = $aArr ; New copy. Yes? SomeFunc($aArr0) Func SomeFunc(ByRef $aArr) Return 1 EndFunc ;==>SomeFunc My other projects or all Link to comment Share on other sites More sharing options...
guinness Posted July 31, 2013 Author Share Posted July 31, 2013 Yes. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
jaberwacky Posted July 31, 2013 Share Posted July 31, 2013 That's an amazing explanation MHz! If you don't mind, I'd like to link to it in my sig. I see now the error of my ways and I hang my head in shame. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
MHz Posted July 31, 2013 Share Posted July 31, 2013 jaberwocky6669, Thanks. You can link to it. No shame if you are able to change. The evidence is in the testing and that is what I base my thoughts on. Link to comment Share on other sites More sharing options...
mLipok Posted July 31, 2013 Share Posted July 31, 2013 @MHz I visit your site and on my first look http://users.tpg.com.au/mpheath/au3_api_updater/ this is very nice Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
MHz Posted July 31, 2013 Share Posted July 31, 2013 mlipok, Thanks. I am glad that you like it. A topic exists for Au3 Api Updater which can be found >here. All bugs, support, comments and any other can be posted there. Now, back to topic for guinness' sake Link to comment Share on other sites More sharing options...
guinness Posted July 31, 2013 Author Share Posted July 31, 2013 I don't mind UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now