frankito Posted October 10, 2009 Posted October 10, 2009 Hi, I've just get a script from a friend which i want to clean up. This script is 10K lines long and there is a couple of useless function or variable. A soft or an editor could help me to do that ? Cheers
corl455 Posted October 10, 2009 Posted October 10, 2009 Hi,I've just get a script from a friend which i want to clean up.This script is 10K lines long and there is a couple of useless function or variable.A soft or an editor could help me to do that ?CheersDownload and install Autoit, it comes with an editor for its code.
frankito Posted October 10, 2009 Author Posted October 10, 2009 Download and install Autoit, it comes with an editor for its code.yes i know but i want an editor with a function to identify and delete useless variable and function...and i don't think auoit editor do it ...
water Posted October 10, 2009 Posted October 10, 2009 (edited) If you install the full AutoIt version you get a lot of useful tools: SciTE: The editor Tidy: To clean the source code in SciTE (makes indention etc. but does not delete unused code) Au3Check: Can inform you about declarded but not used variables obfuscator: strips unused functions, unused variables etc. obfuscator is - with some limitations - what you need. Edited October 10, 2009 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Bowmore Posted October 10, 2009 Posted October 10, 2009 If you install the full AutoIt version you get a lot of useful tools: SciTE: The editor Tidy: To clean the source code in SciTE (makes indention etc. but does not delete unused code) Au3Check: Can inform you about declarded but not used variables obfuscator: strips unused functions, unused variables etc. obfuscator is - with some limitations - what you need. Tidy.exe when used with the /gd /gds options also produces a very useful cross reference report, listing which functions and variables are used and where. This I think will meet the OPs original request. Example of Tidy generated documentation and cross reference report. expandcollapse popup======================================================================================================== === Tidy report for :C:\AutoItData\Projects\temp\test.au3 ======================================================================================================== 00001 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** 00002 #AutoIt3Wrapper_Run_Tidy=y 00003 #Tidy_Parameters=/gd /gds 00004 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** 00005 $Pid = 0 00006 $unsedvar 00007 +-While 1 00008 | Sleep("5000") 00009 | +-If Not ProcessExists($Pid) Then 00010 | | $Pid = ProcessExists("notepad.exe") 00011 | | +-If Not $Pid Then 00012 | | | ShellExecute("notepad.exe") 00013 | | +-EndIf 00014 | +-EndIf 00015 +-WEnd 00016 00017 +-Func _unused() 00018 EndFunc ;==>_unused ====================== === xref reports ===== ====================== == User functions ================================================================================================= Func Function name Row Referenced at Row(s) ========================= ====== ================================================================================== _unused 00017 #### indicates that this specific variable only occurs one time in the script. ---- indicates that this specific variable isn't declared with Dim/Local/Global/Const. == Variables ====================================================================================================== Variable name Dim Used in Row(s) ========================= ===== =================================================================================== $Pid ----- 00005 00009 00010 00011 $unsedvar ----- 00006 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
water Posted October 10, 2009 Posted October 10, 2009 Cool - learned something new today! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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