MHz Posted March 6, 2006 Share Posted March 6, 2006 (edited) Edit: See >post #3 for later code created in 2013 for use in AutoIt 3.3.81 and later. A simple UDF I made based on the idea of returning variable values from a script at the point of runtime closure. I manage to catch the Globals but the Locals would need more impressive code that would need to run within the functions themselves. It maybe useful for some and perhaps fun to others. It is set to dump the variables to Console so is perfect for editors that support this, such as Scite4AutoIt3. Use the latest AutoIt Beta as I used some code that requires it. Method of use: Just add this to the top of a script. Opt('OnExitFunc', '_DebugGlobalVars')Then I insert this UDF to the bottom of the script. expandcollapse popupFunc _DebugGlobalVars() If @Compiled Then Return ConsoleWrite('>Func _DebugGlobalVars()' & @LF) Local $debug_end, $debug_handle_read, $debug_i, $debug_globals Local $debug_j, $debug_k, $debug_length, $debug_line Local $debug_num, $debug_out, $debug_start, $debug_array Local $debug_temp, $debug_total, $debug_var, $debug_string $debug_globals = 0; Extra Output $debug_handle_read = FileOpen(@ScriptFullPath, 0) While 1 $debug_line = FileReadLine($debug_handle_read) If @error Then ExitLoop $debug_line = StringStripWS($debug_line, 3) While StringLeft($debug_line, 1) = ';' $debug_line = FileReadLine($debug_handle_read) $debug_line = StringStripWS($debug_line, 3) WEnd If $debug_line = '' Then ContinueLoop If StringInStr($debug_line, '$debug_') Then ConsoleWrite('!>Variable Name conflict in line: ' & $debug_line & @LF) ContinueLoop EndIf If $debug_line = 'Func _DebugGlobalVars()' Then Do $debug_line = FileReadLine($debug_handle_read) $debug_line = StringStripWS($debug_line, 3) Until $debug_line = 'EndFunc' ContinueLoop EndIf StringReplace($debug_line, '$', '') $debug_num = @extended If $debug_num Then $debug_length = StringLen($debug_line) For $debug_i = 1 To $debug_num $debug_start = StringInStr($debug_line, '$', 0, $debug_i) If @error Then ContinueLoop 2 $debug_end = $debug_start + 1 For $debug_j = $debug_end To $debug_length $debug_temp = StringMid($debug_line, $debug_j, 1) Switch $debug_temp Case ')', ',', ' ', '&', ';' ExitLoop Case '.', '[', "'" ContinueLoop 2 Case ']' ExitLoop EndSwitch Next $debug_var = StringMid($debug_line, $debug_start, $debug_j - $debug_start); $debug_out = StringSplit($debug_total, ', ', 1) If Not @error Then For $debug_k = 1 To $debug_out[0] If $debug_var = $debug_out[$debug_k] Then ContinueLoop 2 Next EndIf $debug_total &= ', ' & $debug_var If StringLeft($debug_total, 2) = ', ' Then $debug_total = StringTrimLeft($debug_total, 2) EndIf $debug_string = StringTrimLeft($debug_var, 1) Switch IsDeclared($debug_string) Case -1, 0 ContinueLoop EndSwitch ConsoleWrite($debug_var & ' = ' & Eval($debug_string) & @LF) Next EndIf WEnd FileClose($debug_handle_read) If $debug_globals Then $debug_array = StringSplit($debug_total, ', ', 1) If Not @error Then ConsoleWrite('Global ') For $i = 1 To $debug_array[0] If StringRight($i, 1) = '0' Then ConsoleWrite(@LF & 'Global ') Else If StringRight($i, 1) = '9' Then ConsoleWrite($debug_array[$i]) Else ConsoleWrite($debug_array[$i] & ', ') EndIf EndIf Next EndIf EndIf ConsoleWrite('>EndFunc' & @LF) EndFunc Edited September 17, 2013 by MHz mLipok 1 Link to comment Share on other sites More sharing options...
mLipok Posted September 17, 2013 Share Posted September 17, 2013 @MHz thank you for this script, it is really very useful 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 September 17, 2013 Author Share Posted September 17, 2013 Thanks mlipok, but I thought you liked the later 2013 version of the code I posted in the help and support forum >here. The code above was probably before StringRegExp existed so it was more differcult to get the variables from the source. It seems to get an error with 3.3.8.1 yet works with a later version so a bug perhaps in 3.3.8.1 which exists. I will post the later code here so you and others know where to find it. Recommended for use with AutoIt 3.3.81 and later. expandcollapse popup#include <array.au3> OnAutoItExitRegister('_DumpGlobalVars') Global _ $string = 'This is a string with a @TAB' & @TAB & 'and it ends with @CRLF' & @CRLF, _ $array[11], _ $binary = StringToBinary($string), _ $bool = True, _ $false = False, _ $float = 12.01, _ $hex = Hex(13), _ $hwnd = WinGetHandle("[CLASS:Shell_TrayWnd]"), _ $int = 14, _ $keyword = Default, _ $number = Number(15.01), _ $ptr = Ptr(16), _ $struct = DllStructCreate('char[' & 65536 & ']'), _ $true = True Exit Func _DumpGlobalVars() Local $__content, $__string, $__variable, $__format = '%-10s%-15s%s' If @Compiled Then Return $__content = StringRegExpReplace(FileRead(@ScriptFullPath), '(*ANYCRLF);.*', '') $__content = StringRegExp($__content, '(?<=\$)\w+?\b', 3) If IsArray($__content) Then $__content = _ArrayUnique($__content) _ArraySort($__content) $__string = StringFormat($__format, 'TYPE', 'VARIABLE', 'VALUE') & @CRLF For $__variable In $__content If IsDeclared($__variable) = 1 Then $__string &= StringFormat($__format, VarGetType(Eval($__variable)), '$' & $__variable, Eval($__variable)) & @CRLF EndIf Next ConsoleWrite($__string & @CRLF) Else ConsoleWriteError('No variables found' & @CRLF) EndIf EndFunc Here is the output. TYPE VARIABLE VALUE Array $array Binary $binary 0x54686973206973206120737472696E6720776974682061204054414209616E6420697420656E64732077697468204043524C460D0A Bool $bool True Bool $false False Double $float 12.01 String $hex 0000000D Ptr $hwnd 0x0001007E Int32 $int 14 Keyword $keyword Default Double $number 15.01 Ptr $ptr 0x00000010 String $string This is a string with a @TAB and it ends with @CRLF DLLStruct $struct Bool $true True Note: Does not work with compiled scripts so I added a early return from the function if it is compiled. Link to comment Share on other sites More sharing options...
mLipok Posted September 17, 2013 Share Posted September 17, 2013 (edited) Thanks mlipok, but I thought you liked the later 2013 version of the code I posted in the help and support forum >here. Both versions are worth it to them like Well unless you are outraged ... I can remove the LIKE. Your script inspired me I'm doing a modification, as I finish, I would put it here. Edited September 17, 2013 by mlipok 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...
mLipok Posted September 17, 2013 Share Posted September 17, 2013 (edited) EDIT: modified 2013/09/21 04:30 for new version look here: so this is my modification: first you need additional script "Variable_list.au3": EDIT: modified 2013/09/18 02:38 expandcollapse popup;~ http://www.autoitscript.com/forum/topic/22625-output-global-variables-on-exit #include <array.au3> If $CmdLine[0] = 1 Then ConsoleWrite('Variable_list: using file: ' & $CmdLine[1] & @CRLF) _DumpGlobalVars($CmdLine[1]) Else _DumpGlobalVars(FileOpenDialog('Select Au3 File', @ScriptDir, 'Au3 File (*.au3)')) EndIf Func _DumpGlobalVars($fFile) Local $sVariableList = '' Local $sFileContent = FileRead($fFile) Local $__content = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $__content = StringRegExp($__content, '(?<=Global )(\$.*?)(?:\s|\[)', 3) If IsArray($__content) = 0 Then ConsoleWrite('Variable_list: IsArray($__content) = ' & IsArray($__content) & @CRLF) $sVariableList = '$sVariableList = ""' Else $__content = _ArrayUnique($__content) _ArrayDelete($__content, 0) If _ArraySearch($__content, '$sVariableList') <> -1 Then _ArrayDelete($__content, _ArraySearch($__content, '$sVariableList')) _ArraySort($__content) $sVariableList = 'Global $sVariableList = ""' & @CRLF $sVariableList &= '$sVariableList &= "' ConsoleWrite('Variable_list: _ArrayToString: START:' & @CRLF) ConsoleWrite(_ArrayToString($__content) & @CRLF) ConsoleWrite('Variable_list: _ArrayToString: END:' & @CRLF) For $iVar = 0 To (UBound($__content) - 1) $sVariableList &= $__content[$iVar] & '|' If $iVar = (UBound($__content) - 1) Then $sVariableList = StringTrimRight($sVariableList, 1) & '"' & @CRLF Else If Mod(Number($iVar + 1), 5) = 0 Then $sVariableList &= '"' & @CRLF $sVariableList &= '$sVariableList &= "' EndIf EndIf Next EndIf Local $sRegion = '' $sRegion &= '#region $sVariableList' & @CRLF $sRegion &= $sVariableList & @CRLF $sRegion &= '#endregion $sVariableList' & @CRLF ConsoleWrite('Adding:' & @CRLF) ConsoleWrite($sRegion & @CRLF) $sFileContent = StringRegExpReplace($sFileContent, '(?is)\#region \$sVariableList.*?\#endregion \$sVariableList\r\n', $sRegion) If @extended = 0 Then $sFileContent = $sRegion & @CRLF & $sFileContent FileMove($fFile, StringReplace($fFile, '.au3', '__VariableList_BackUp.au3')) FileWrite(@ScriptDir & 'VariableList_temp.au3', $sFileContent) FileMove(@ScriptDir & 'VariableList_temp.au3', $fFile, 1) EndFunc ;==>_DumpGlobalVars compile them to Variable_list.exe now try to compile this "test_Variable_DUMB.au3": expandcollapse popup#AutoIt3Wrapper_Run_Before=Variable_list.exe %in% ;~ http://www.autoitscript.com/forum/topic/22625-output-global-variables-on-exit/ #include <array.au3> OnAutoItExitRegister('_DumpGlobalVars') Global $string = 'This is a string with a @TAB' & @TAB & 'and it ends with @CRLF' & @CRLF Global $array[11] Global $binary = StringToBinary($string) Global $bool = True Global $false = False Global $float = 12.01 Global $hex = Hex(13) Global $hwnd = WinGetHandle("[CLASS:Shell_TrayWnd]") Global $int = 14 Global $keyword = Default Global $number = Number(15.01) Global $ptr = Ptr(16) Global $struct = DllStructCreate('char[' & 65536 & ']') Global $true = True For $i = 1 to 10 $int = $i MsgBox(1,'Test',_DumpGlobalVars()) Next Exit Func _DumpGlobalVars() Local $__content, $__string, $__variable, $__format = '%-10s%-15s%s' $__content = StringReplace($sVariableList,'$','') $__content = StringSplit($__content,'|') If IsArray($__content) Then $__content = _ArrayUnique($__content) _ArraySort($__content) $__string = StringFormat($__format, 'TYPE', 'VARIABLE', 'VALUE') & @CRLF For $__variable In $__content If IsDeclared($__variable) = 1 Then $__string &= StringFormat($__format, VarGetType(Eval($__variable)), '$' & $__variable, Eval($__variable)) & @CRLF EndIf Next ConsoleWrite($__string & @CRLF) Else ConsoleWriteError('No variables found' & @CRLF) EndIf Return $__string EndFunc ;==>_DumpGlobalVars and run "test_Variable_DUMB.exe" So what you think about this modification ? EDIT: Do you see that $int value is changing in MsgBox, even if the script is compiled, and without the need to use FileInstall. ps. I'm not done with this script, I have in mind one more extra brilliant idea. ie a combination of this function with another function, which not long ago, I learned to use. Edited September 21, 2013 by mlipok 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...
michaelslamet Posted September 18, 2013 Share Posted September 18, 2013 @Mlipok test_Variable_DUMB.au3(36,46) : ERROR: $sVariableList: undeclared global variable. WinXP, 3.8.8.1 Link to comment Share on other sites More sharing options...
mLipok Posted September 18, 2013 Share Posted September 18, 2013 (edited) is "test_Variable_DUMB.au3" and "Variable_list.au3" and "Variable_list.exe" in the same folder ? EDIT: "Variable_list.exe" do you Build this before using "test_Variable_DUMB.au3" ? Edited September 18, 2013 by mlipok 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...
michaelslamet Posted September 18, 2013 Share Posted September 18, 2013 Yes, I build variable_list.exe first before test_variable_dump.exe all au3 are in the same folder. Link to comment Share on other sites More sharing options...
mLipok Posted September 18, 2013 Share Posted September 18, 2013 (edited) all au3 are in the same folder. where is "variable_list.exe" where is "test_variable_dump.exe" EDIT: you write au3 i mean *.au3 Edited September 18, 2013 by mlipok 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...
mLipok Posted September 18, 2013 Share Posted September 18, 2013 show me console output when you build/compile "test_variable_dump.au3" 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...
michaelslamet Posted September 18, 2013 Share Posted September 18, 2013 C:Documents and SettingsWindowsDesktopapp>dir *var*.* Volume in drive C is Program Volume Serial Number is 88D5-32C1 Directory of C:Documents and SettingsWindowsDesktopapp 16/09/2013 07:07 21.960 list-all-var-azjio.au3 16/09/2013 07:16 4.518 list-all-var.au3 16/09/2013 07:16 665.675 list-all-var.exe 16/09/2013 07:08 12.130 renaming-var-azjio.au3 18/09/2013 07:11 1.734 test_Variable_DUMB.au3 18/09/2013 07:08 2.481 variable_list.au3 18/09/2013 07:08 659.009 variable_list.exe 7 File(s) 1.367.507 bytes 0 Dir(s) 36.277.379.072 bytes free >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /ShowGui /in "C:Documents and SettingsWindowsDesktopapptest_Variable_DUMB.au3" +>07:20:39 Starting AutoIt3Wrapper v.2.1.0.33 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X64 OS:X86) -> No changes made.. > Running:Variable_list.exe C:Documents and SettingsWindowsDesktopapptest_Variable_DUMB.au3 >Running AU3Check (1.54.22.0) from:C:Program FilesAutoIt3 C:Documents and SettingsWindowsDesktopapptest_Variable_DUMB.au3(35,46) : WARNING: $sVariableList: possibly used before declaration. $__content = StringReplace($sVariableList, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:Documents and SettingsWindowsDesktopapptest_Variable_DUMB.au3(35,46) : ERROR: $sVariableList: undeclared global variable. $__content = StringReplace($sVariableList, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:Documents and SettingsWindowsDesktopapptest_Variable_DUMB.au3 - 1 error(s), 1 warning(s) !>07:20:42 AU3Check ended. Press F4 to jump to next error.rc:2 >Exit code: 0 Time: 2.973 Link to comment Share on other sites More sharing options...
mLipok Posted September 18, 2013 Share Posted September 18, 2013 (edited) use "Variable_list.au3": modified 2013/09/18 02:38 this is my Console Output: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "L:\TOOLs\Macro\test_Variable_DUMB.au3" +>02:36:20 Starting AutoIt3Wrapper v.2.1.2.29 SciTE v.3.3.2.0 ; Keyboard:00000415 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0415 Keyboard:00000415 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) > Running:Variable_list.exe L:\TOOLs\Macro\test_Variable_DUMB.au3 Variable_list: using file: L:\TOOLs\Macro\test_Variable_DUMB.au3 Variable_list: _ArrayToString: START: $array|$binary|$bool|$false|$float|$hex|$hwnd|$int|$keyword|$number|$ptr|$string|$struct|$true Variable_list: _ArrayToString: END: Adding: #region $sVariableList Global $sVariableList = "" $sVariableList &= "$array|$binary|$bool|$false|$float|" $sVariableList &= "$hex|$hwnd|$int|$keyword|$number|" $sVariableList &= "$ptr|$string|$struct|$true" #endregion $sVariableList >Running AU3Check (3.3.9.5) from:C:\Program Files (x86)\AutoIt3 +>02:36:21 AU3Check ended.rc:0 >Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe /in "L:\TOOLs\Macro\test_Variable_DUMB.au3" /out "C:\Users\user\~AU3hfeyfan.exe" /nopack /comp 2 +>02:36:22 Aut2exe.exe ended.C:\Users\user\~AU3hfeyfan.exe. rc:0 +>02:36:22 Created program:L:\TOOLs\Macro\test_Variable_DUMB.exe >Exit code: 0 Time: 2.554 EDIT: Variable_list.exe parses the file: L:TOOLsMacrotest_Variable_DUMB.au3 and adds the appropriate variable ($sVariableList) at the beginning of the script, > Running:Variable_list.exe L:TOOLsMacrotest_Variable_DUMB.au3 Variable_list: using file: L:TOOLsMacrotest_Variable_DUMB.au3 Variable_list: _ArrayToString: START: $array|$binary|$bool|$false|$float|$hex|$hwnd|$int|$keyword|$number|$ptr|$string|$struct|$true Variable_list: _ArrayToString: END: Adding: #region $sVariableList Global $sVariableList = "" $sVariableList &= "$array|$binary|$bool|$false|$float|" $sVariableList &= "$hex|$hwnd|$int|$keyword|$number|" $sVariableList &= "$ptr|$string|$struct|$true" #endregion $sVariableList Edited September 18, 2013 by mlipok 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 September 18, 2013 Author Share Posted September 18, 2013 I'm not done with this script, I have in mind one more extra brilliant idea. ie a combination of this function with another function, which not long ago, I learned to use. Let the brilliance show. I notice your regexps do this Local $sFileContent = FileRead($fFile) Local $__content = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $__content = StringRegExp($__content, '(?<=Global )(\$.*?)(?:\s|\[)', 3) I do not see how $__content can change other then on a couple of the lines. Perhaps it should be like this? Local $sFileContent = FileRead($fFile) Local $__content = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $__content = StringRegExpReplace($__content, '(\s{2,})', ' ') $__content = StringRegExpReplace($__content, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $__content = StringRegExp($__content, '(?<=Global )(\$.*?)(?:\s|\[)', 3) so that $__content gets processed over and over by feeding it as a parameter of the regexp functions. Looks like you have some good ideas mlipok. Keep them coming. Looks like the forum software is stripping some backslashs off the code posted that everyone may need to correct before running the code. Link to comment Share on other sites More sharing options...
mLipok Posted September 18, 2013 Share Posted September 18, 2013 Let the brilliance show. I notice your regexps do this Local $sFileContent = FileRead($fFile) Local $__content = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(\s{2,})', ' ') $__content = StringRegExpReplace($sFileContent, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $__content = StringRegExp($__content, '(?<=Global )(\$.*?)(?:\s|\[)', 3) I do not see how $__content can change other then on a couple of the lines. Perhaps it should be like this? Local $sFileContent = FileRead($fFile) Local $__content = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $__content = StringRegExpReplace($__content, '(\s{2,})', ' ') $__content = StringRegExpReplace($__content, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $__content = StringRegExp($__content, '(?<=Global )(\$.*?)(?:\s|\[)', 3) so that $__content gets processed over and over by feeding it as a parameter of the regexp functions. Let the brilliance show. Looks like you have some good ideas mlipok. Keep them coming. I working on. Looks like the forum software is stripping some backslashs off the code posted that everyone may need to correct before running the code. ? 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...
mLipok Posted September 21, 2013 Share Posted September 21, 2013 (edited) First I want to thanks to: @Mhz for this scirpt: '?do=embed' frameborder='0' data-embedContent>> Secondly I want to thanks to: @trancexx for this scirpt: '?do=embed' frameborder='0' data-embedContent>> So below it is my final modification (i think so ) : HOW IT WORKS First you need additional script "Variable_list.au3": expandcollapse popup;~ http://www.autoitscript.com/forum/topic/22625-output-global-variables-on-exit #include <array.au3> If $CmdLine[0] = 1 Then ConsoleWrite('Variable_list: using file: ' & $CmdLine[1] & @CRLF) _ListOfGlobalVariables($CmdLine[1]) _FunctionStartStop($CmdLine[1]) Else ; only for testing Local $fFile = FileOpenDialog('Select Au3 File', @ScriptDir, 'Au3 File (*.au3)') _ListOfGlobalVariables($fFile) _FunctionStartStop($fFile) EndIf Func _ListOfGlobalVariables($fFile) Local $_sGlobalVariableList = '' Local $sFileContent = FileRead($fFile) Local $sFileContent_temp = StringRegExpReplace($sFileContent, '(*ANYCRLF)\s*;.*', '') $sFileContent_temp = StringRegExpReplace($sFileContent_temp, '(\s{2,})', ' ') $sFileContent_temp = StringRegExpReplace($sFileContent_temp, '(?is)(Func .*?EndFunc.*?\r\n', @CRLF) $sFileContent_temp = StringRegExpReplace($sFileContent_temp, '(?is)(\#ce.*?\#cs|\#comments-start.*?\#comments-end)', '') Local $aTempGlobalVariableList = StringRegExp($sFileContent_temp, '(?<=Global )(\$.*?)(?:\s|\[)', 3) If IsArray($aTempGlobalVariableList) = 0 Then ConsoleWrite('Variable_list: IsArray($aTempGlobalVariableList) = ' & IsArray($aTempGlobalVariableList) & @CRLF) $_sGlobalVariableList = '$_sGlobalVariableList = ""' Else $aTempGlobalVariableList = _ArrayUnique($aTempGlobalVariableList) _ArrayDelete($aTempGlobalVariableList, 0) If _ArraySearch($aTempGlobalVariableList, '$_sGlobalVariableList') <> -1 Then _ArrayDelete($aTempGlobalVariableList, _ArraySearch($aTempGlobalVariableList, '$_sGlobalVariableList')) _ArraySort($aTempGlobalVariableList) $_sGlobalVariableList = 'Global $_sGlobalVariableList = ""' & @CRLF $_sGlobalVariableList &= '$_sGlobalVariableList &= "' ConsoleWrite('Variable_list: _ArrayToString: START:' & @CRLF) ConsoleWrite(_ArrayToString($aTempGlobalVariableList) & @CRLF) ConsoleWrite('Variable_list: _ArrayToString: END:' & @CRLF) For $iVar = 0 To (UBound($aTempGlobalVariableList) - 1) $_sGlobalVariableList &= $aTempGlobalVariableList[$iVar] & '|' If $iVar = (UBound($aTempGlobalVariableList) - 1) Then $_sGlobalVariableList = StringTrimRight($_sGlobalVariableList, 1) & '"' & @CRLF Else If Mod(Number($iVar + 1), 5) = 0 Then $_sGlobalVariableList &= '"' & @CRLF $_sGlobalVariableList &= '$_sGlobalVariableList &= "' EndIf EndIf Next EndIf Local $sGlobalVariableRegion = '' $sGlobalVariableRegion &= '#region Global and Local "Variable List Declaration"' & @CRLF $sGlobalVariableRegion &= $_sGlobalVariableList & @CRLF $sGlobalVariableRegion &= '#endregion Global and Local "Variable List Declaration"' & @CRLF ConsoleWrite('Adding:' & @CRLF) ConsoleWrite($sGlobalVariableRegion & @CRLF) ; cleaning for old variable name $sVariableList $sFileContent = StringRegExpReplace($sFileContent, '(?is)\#region \$sVariableList.*?\#endregion \$sVariableList\r\n', '') ; cleaning new variable name $_sGlobalVariableList $sFileContent = StringRegExpReplace($sFileContent, '(?is)\#region Global and Local \"Variable List Declaration\".*?\#endregion Global and Local \"Variable List Declaration\"\r\n', $sGlobalVariableRegion) If @extended = 0 Then $sFileContent = $sGlobalVariableRegion & @CRLF & $sFileContent FileMove($fFile, StringReplace($fFile, '.au3', '__VariableList_BackUp.au3')) FileWrite(@ScriptDir & 'VariableList_temp.au3', $sFileContent) FileMove(@ScriptDir & 'VariableList_temp.au3', $fFile, 1) EndFunc ;==>_ListOfGlobalVariables Func _FunctionStartStop($fFile) Local $_sLocalVariableList = '' Local $sFunc_new = '' Local $aFuncName = '' Local $sFileContent = FileRead($fFile) $sFileContent = StringRegExpReplace($sFileContent, '(?i)\r\n\s*?_Func_start.*?\r\n', @CRLF) $sFileContent = StringRegExpReplace($sFileContent, '(?i)\r\n\s*?_Func_End.*?\r\n', @CRLF) $aFunctions = StringRegExp($sFileContent, '(?is)(Func .*?EndFunc.*?\r\n)', 3) For $sFunc In $aFunctions If _ StringInStr($sFunc, 'Func Intercept_MessageBoxW(') = 0 And _ StringInStr($sFunc, 'Func AddHookApi(') = 0 And _ StringInStr($sFunc, 'Func VirtualProtect(') = 0 And _ StringInStr($sFunc, 'Func ImageDirectoryEntryToData(') = 0 And _ StringInStr($sFunc, 'Func _GetVariablesValue(') = 0 And _ StringInStr($sFunc, '_Func_Start(') = 0 And _ StringInStr($sFunc, '_Func_End(') = 0 _ Then $sFunc_new = StringRegExpReplace($sFunc, '(?is)(Func )(.*?)(\(.*?\)\r\n)(.*?)(EndFunc.*?\r\n)', '$1$2$3 _Func_Start("$2")' & @CRLF & '$4 _Func_End("$2")' & @CRLF & '$5') $aFuncName = StringRegExp($sFunc_new, '(?i)(?:Func )(.*?)(?:\()', 3) $sFunc_new = StringRegExpReplace($sFunc_new, '(?i)(\r\n)(\s*?)(Return)', @CRLF & '$2_Func_End("' & $aFuncName[0] & '")$1$2$3') $sFunc_new = StringRegExpReplace($sFunc_new, '(?i)(_Func_End.*\r\n\s*?Return.*?)(\r\n\s*_Func_End\(.*?\))', '$1') $sFileContent = StringReplace($sFileContent, $sFunc, $sFunc_new) EndIf Next FileMove($fFile, StringReplace($fFile, '.au3', '__VariableList_BackUp.au3')) FileWrite(@ScriptDir & 'VariableList_temp.au3', $sFileContent) FileMove(@ScriptDir & 'VariableList_temp.au3', $fFile, 1) EndFunc ;==>_FunctionStartStop Build/Compile them to Variable_list.exe Now try to build/compile this "test_Variable_DUMP.au3": expandcollapse popup#AutoIt3Wrapper_Run_Before=Variable_list.exe %in% ;~ http://www.autoitscript.com/forum/topic/22625-output-global-variables-on-exit/ #include "WinAPIEx.au3" #include <array.au3> OnAutoItExitRegister('_GetVariablesValue') AddHookApi("user32.dll", "MessageBoxW", "Intercept_MessageBoxW", "int", "hwnd;wstr;wstr;uint") Global $string = 'This is a string with a @TAB' & @TAB & 'and it ends with @CRLF' & @CRLF Global $array[11] Global $binary = StringToBinary($string) Global $bool = True Global $false = False Global $float = 12.01 Global $hex = Hex(13) Global $hwnd = WinGetHandle("[CLASS:Shell_TrayWnd]") Global $int = 14 Global $keyword = Default Global $number = Number(15.01) Global $ptr = Ptr(16) Global $struct = DllStructCreate('char[' & 65536 & ']') Global $true = True Global $aFuncNames[20] For $i = 1 To 3 $int = $i MsgBox(0, 'Test $int changing:', _GetVariablesValue()) Next _test_Main() MsgBox(0, 'CRASH', $aFuncNames[40]) Exit Func _GetVariablesValue() Local $__content, $__string, $__variable, $__format = '%-10s%-15s%s' $__content = StringReplace($_sGlobalVariableList, '$', '') $__content = StringSplit($__content, '|') If IsArray($__content) Then $__content = _ArrayUnique($__content) _ArraySort($__content) $__string = '_ListOfGlobalVariables' & @CRLF $__string &= StringFormat($__format, 'TYPE', 'VARIABLE', 'VALUE') & @CRLF $__string &= StringFormat($__format, '====', '========', '=====') & @CRLF For $__variable In $__content If IsDeclared($__variable) = 1 Then $__string &= StringFormat($__format, VarGetType(Eval($__variable)), '$' & $__variable, Eval($__variable)) & @CRLF EndIf Next ConsoleWrite($__string & @CRLF) Else ConsoleWriteError('No variables found' & @CRLF) EndIf $__string &= '============================' & @CRLF & 'Functions' & @CRLF & _ArrayToString($aFuncNames, @CRLF) Return $__string EndFunc ;==>_GetVariablesValue Func _test_Main() Local $sMain_local_1 = 'aa' Local $sMain_local_2 = 1 Local $sMain_local_3 = 1 Local $sMain_local_4 = 1 Local $sMain_local_5 = 1 Local $sMain_local_6 = 1 Local $sMain_local_7 = 1 MsgBox(0, '_test_Main : 1', _GetVariablesValue()) _test_Func_1() MsgBox(0, '_test_Func_1', _GetVariablesValue()) _test_Func_2(True) MsgBox(0, '_test_Func_2:True', _GetVariablesValue()) _test_Func_2(False) MsgBox(0, '_test_Func_2:False', _GetVariablesValue()) _test_Func_3() MsgBox(0, '_test_Func_3', _GetVariablesValue()) _test_Func_4() MsgBox(0, '_test_Func_4', _GetVariablesValue()) EndFunc ;==>_test_Main Func _test_Func_1() Local $sTest_local_1_1 = 'aa' Local $sTest_local_1_2 = 1 EndFunc ;==>_test_Func_1 Func _test_Func_2($fTest) Local $sTest_local_2_1 = 'aa' Local $sTest_local_2_2 = 1 If $fTest = True Then Return Else ;~ EndIf Return 'abc' EndFunc ;==>_test_Func_2 Func _test_Func_3() Local $sTest_local_1_1 = 'aa' Local $sTest_local_1_2 = 1 EndFunc ;==>_test_Func_3 Func _test_Func_4() Local $sTest_local_1_1 = 'aa' Local $sTest_local_1_2 = 1 EndFunc ;==>_test_Func_4 Func _Func_Start($sFuncName) _ArrayPush($aFuncNames, '_Func_Start: ' & $sFuncName) EndFunc ;==>_Func_Start Func _Func_End($sFuncName) _ArrayPush($aFuncNames, '_Func_End: ' & $sFuncName) EndFunc ;==>_Func_End Func Intercept_MessageBoxW($hwnd, $sText, $sTitle, $iType) ;~ http://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/ Local $sText_old = $sText, $sTitle_old = $sTitle, $iType_old = $iType If _ StringInStr($sText, @ScriptFullPath) <> 0 And _ StringInStr($sText, 'Error:') <> 0 And _ StringInStr($sTitle, 'AutoIt Error') <> 0 _ Then $sText &= @CRLF & @CRLF & _GetVariablesValue() EndIf Local $aCall = DllCall("user32.dll", "int", "MessageBoxW", _ "hwnd", $hwnd, _ "wstr", $sText, _ "wstr", $sTitle, _ "uint", $iType) If @error Or Not $aCall[0] Then Return 0 Return $aCall[0] EndFunc ;==>Intercept_MessageBoxW Func AddHookApi($sModuleName, $vFunctionName, $vNewFunction, $sRet = "", $sParams = "") ;~ http://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/ ; The magic is down below Local Static $pImportDirectory, $hInstance Local Const $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 If Not $pImportDirectory Then $hInstance = _WinAPI_GetModuleHandle(0) $pImportDirectory = ImageDirectoryEntryToData($hInstance, $IMAGE_DIRECTORY_ENTRY_IMPORT) If @error Then Return SetError(1, 0, 0) EndIf Local $iIsInt = IsInt($vFunctionName) Local $iRestore = Not IsString($vNewFunction) Local $tIMAGE_IMPORT_MODULE_DIRECTORY Local $pDirectoryOffset = $pImportDirectory Local $tModuleName Local $iInitialOffset, $iInitialOffset2 Local $iOffset2 Local $tBufferOffset2, $iBufferOffset2 Local $tBuffer, $tFunctionOffset, $pOld, $fMatch, $pModuleName, $pFuncName Local Const $PAGE_READWRITE = 0x04 While 1 $tIMAGE_IMPORT_MODULE_DIRECTORY = DllStructCreate("dword RVAOriginalFirstThunk;" & _ "dword TimeDateStamp;" & _ "dword ForwarderChain;" & _ "dword RVAModuleName;" & _ "dword RVAFirstThunk", _ $pDirectoryOffset) If Not DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAFirstThunk") Then ExitLoop $pModuleName = $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAModuleName") $tModuleName = DllStructCreate("char Name[" & _WinAPI_StringLenA($pModuleName) & "]", $pModuleName) If DllStructGetData($tModuleName, "Name") = $sModuleName Then ; function from this module $iInitialOffset = $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAFirstThunk") $iInitialOffset2 = $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAOriginalFirstThunk") If $iInitialOffset2 = $hInstance Then $iInitialOffset2 = $iInitialOffset $iOffset2 = 0 While 1 $tBufferOffset2 = DllStructCreate("dword_ptr", $iInitialOffset2 + $iOffset2) $iBufferOffset2 = DllStructGetData($tBufferOffset2, 1) If Not $iBufferOffset2 Then ExitLoop If $iIsInt Then If BitAND($iBufferOffset2, 0xFFFFFF) = $vFunctionName Then $fMatch = True; wanted function Else $pFuncName = $hInstance + $iBufferOffset2 + 2 ; 2 is size od "word", see line below... $tBuffer = DllStructCreate("word Ordinal; char Name[" & _WinAPI_StringLenA($pFuncName) & "]", $hInstance + $iBufferOffset2) If DllStructGetData($tBuffer, "Name") == $vFunctionName Then $fMatch = True; wanted function EndIf If $fMatch Then $tFunctionOffset = DllStructCreate("ptr", $iInitialOffset + $iOffset2) VirtualProtect(DllStructGetPtr($tFunctionOffset), DllStructGetSize($tFunctionOffset), $PAGE_READWRITE) If @error Then Return SetError(3, 0, 0) $pOld = DllStructGetData($tFunctionOffset, 1) If $iRestore Then DllStructSetData($tFunctionOffset, 1, $vNewFunction) Else DllStructSetData($tFunctionOffset, 1, DllCallbackGetPtr(DllCallbackRegister($vNewFunction, $sRet, $sParams))) EndIf Return $pOld EndIf $iOffset2 += DllStructGetSize($tBufferOffset2) WEnd ExitLoop EndIf $pDirectoryOffset += 20 ; size of $tIMAGE_IMPORT_MODULE_DIRECTORY WEnd Return SetError(4, 0, 0) EndFunc ;==>AddHookApi Func VirtualProtect($pAddress, $iSize, $iProtection) ;~ http://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/ Local $aCall = DllCall("kernel32.dll", "bool", "VirtualProtect", "ptr", $pAddress, "dword_ptr", $iSize, "dword", $iProtection, "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>VirtualProtect Func ImageDirectoryEntryToData($hInstance, $iDirectoryEntry) ;~ http://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/ ; Get pointer to data Local $pPointer = $hInstance ; Start processing passed binary data. 'Reading' PE format follows. Local $tIMAGE_DOS_HEADER = DllStructCreate("char Magic[2];" & _ "word BytesOnLastPage;" & _ "word Pages;" & _ "word Relocations;" & _ "word SizeofHeader;" & _ "word MinimumExtra;" & _ "word MaximumExtra;" & _ "word SS;" & _ "word SP;" & _ "word Checksum;" & _ "word IP;" & _ "word CS;" & _ "word Relocation;" & _ "word Overlay;" & _ "char Reserved[8];" & _ "word OEMIdentifier;" & _ "word OEMInformation;" & _ "char Reserved2[20];" & _ "dword AddressOfNewExeHeader", _ $pPointer) Local $sMagic = DllStructGetData($tIMAGE_DOS_HEADER, "Magic") ; Check if it's valid format If Not ($sMagic == "MZ") Then Return SetError(1, 0, 0) ; MS-DOS header missing. Btw 'MZ' are the initials of Mark Zbikowski in case you didn't know. ; Move pointer $pPointer += DllStructGetData($tIMAGE_DOS_HEADER, "AddressOfNewExeHeader") ; move to PE file header ; In place of IMAGE_NT_SIGNATURE structure Local $tIMAGE_NT_SIGNATURE = DllStructCreate("dword Signature", $pPointer) ; Check signature If DllStructGetData($tIMAGE_NT_SIGNATURE, "Signature") <> 17744 Then ; IMAGE_NT_SIGNATURE Return SetError(2, 0, 0) ; wrong signature. For PE image should be "PE\0\0" or 17744 dword. EndIf ; Move pointer $pPointer += 4 ; size of $tIMAGE_NT_SIGNATURE structure ; In place of IMAGE_FILE_HEADER structure Local $tIMAGE_FILE_HEADER = DllStructCreate("word Machine;" & _ "word NumberOfSections;" & _ "dword TimeDateStamp;" & _ "dword PointerToSymbolTable;" & _ "dword NumberOfSymbols;" & _ "word SizeOfOptionalHeader;" & _ "word Characteristics", _ $pPointer) ; Get number of sections Local $iNumberOfSections = DllStructGetData($tIMAGE_FILE_HEADER, "NumberOfSections") ; Move pointer $pPointer += 20 ; size of $tIMAGE_FILE_HEADER structure ; Determine the type Local $tMagic = DllStructCreate("word Magic;", $pPointer) Local $iMagic = DllStructGetData($tMagic, 1) Local $tIMAGE_OPTIONAL_HEADER If $iMagic = 267 Then ; x86 version ; Move pointer $pPointer += 96 ; size of $tIMAGE_OPTIONAL_HEADER ElseIf $iMagic = 523 Then ; x64 version ; Move pointer $pPointer += 112 ; size of $tIMAGE_OPTIONAL_HEADER Else Return SetError(3, 0, 0) ; unsupported module type EndIf ; Validate input by checking available number of structures that are in the module Local Const $IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16 ; predefined value that PE modules always use (AutoIt certainly) If $iDirectoryEntry > $IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1 Then Return SetError(4, 0, 0) ; invalid input ; Calculate the offset to wanted entry (every entry is 8 bytes) $pPointer += 8 * $iDirectoryEntry ; At place of correst directory entry Local $tIMAGE_DIRECTORY_ENTRY = DllStructCreate("dword VirtualAddress; dword Size", $pPointer) ; Collect data Local $pAddress = DllStructGetData($tIMAGE_DIRECTORY_ENTRY, "VirtualAddress") If $pAddress = 0 Then Return SetError(5, 0, 0) ; invalid input ; $pAddress is RVA, add it to base address Return $hInstance + $pAddress EndFunc ;==>ImageDirectoryEntryToData Run test_Variable_DUMP.exe Do you see that $int value is changing in MsgBox, even if the script is compiled, and without the need to use FileInstall. Do you see what happen when program crash in compiled version on this line: MsgBox(0, 'CRASH', $aFuncNames[40]) What you think about Functions monitoring I mean _Func_Start() _Func_End(), and $aFuncNames[20] So what you think about this modification ? EDIT 2013/09/22 12:18: add attachment (au3 file) Variable_list.au3test_Variable_DUMP.au3 Edited September 22, 2013 by mlipok 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...
BrewManNH Posted September 21, 2013 Share Posted September 21, 2013 Is that supposed to be DUMB or DUMP? DUMB seems a bit silly for the file name whereas DUMP makes sense. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mLipok Posted September 21, 2013 Share Posted September 21, 2013 Thank you for correcting my vocabulary Now I correct my mistake BrewManNH 1 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...
michaelslamet Posted September 22, 2013 Share Posted September 22, 2013 @Mlipok: Tried on WinXP Prof, AutoIT 3.8.8.1 Compile variable_list.au3 is no problem. Compile test_variable_DUMP.au3 popup an AutoIT Error Msgbox: "Line 741 (File "c:blablblavariable_list.exe" Error: Variable must be of type "Object". >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /ShowGui /in "C:Documents and SettingswindowsDesktopapptest_Variable_DUMP.au3" +>11:32:23 Starting AutoIt3Wrapper v.2.1.0.33 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X64 OS:X86) -> No changes made.. > Running:Variable_list.exe C:Documents and SettingswindowsDesktopapptest_Variable_DUMP.au3 Variable_list: IsArray($aTempGlobalVariableList) = 0 Adding: #region Global and Local "Variable List Declaration" $_sGlobalVariableList = "" #endregion Global and Local "Variable List Declaration" >Running AU3Check (1.54.22.0) from:C:Program FilesAutoIt3 C:Documents and SettingswindowsDesktopapptest_Variable_DUMP.au3(41,53) : WARNING: $_sGlobalVariableList: possibly used before declaration. $__content = StringReplace($_sGlobalVariableList, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:Documents and SettingswindowsDesktopapptest_Variable_DUMP.au3(41,53) : ERROR: $_sGlobalVariableList: undeclared global variable. $__content = StringReplace($_sGlobalVariableList, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:Documents and SettingswindowsDesktopapptest_Variable_DUMP.au3 - 1 error(s), 1 warning(s) !>11:34:33 AU3Check ended. Press F4 to jump to next error.rc:2 >Exit code: 0 Time: 131.115 Somehow, I dont think it will error on Win7, but could only test it tommorow because today I dont have an access to the Win7 machine. Link to comment Share on other sites More sharing options...
mLipok Posted September 22, 2013 Share Posted September 22, 2013 I think you are using old Variable_list.au3 because I do not see in output a results from this line: ConsoleWrite('Variable_list: using file: ' & $CmdLine[1] & @CRLF) ps. I add 2 au3 files (attachment to post #15) 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...
michaelslamet Posted September 22, 2013 Share Posted September 22, 2013 I can assure you, I use the latest variable_list.au3 and list dump.au3. Downloaded those files from post #15, still the same error 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