frankito Posted October 10, 2009 Share 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 Link to comment Share on other sites More sharing options...
corl455 Posted October 10, 2009 Share 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. Link to comment Share on other sites More sharing options...
frankito Posted October 10, 2009 Author Share 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 ... Link to comment Share on other sites More sharing options...
frankito Posted October 10, 2009 Author Share Posted October 10, 2009 so i guess it doesn't exists .. ? Link to comment Share on other sites More sharing options...
water Posted October 10, 2009 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Bowmore Posted October 10, 2009 Share 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 Link to comment Share on other sites More sharing options...
water Posted October 10, 2009 Share Posted October 10, 2009 Cool - learned something new today! My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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