Search the Community
Showing results for tags 'BestCodingPractice'.
-
Using this script you can analyze the old scripts and search for keywords like: Local Global Dim Static Search only the above keywords used inside the Loop statements like: For ... Next While ... Wend Do ... Until For ... In ... Next This script parses a other script and reports on incorrect variable declarations within loops. Remark: Variable declaration is needed but it should be done outside the loop. Basic information of this script: Currently, the script provides two functions: _Check_Local_In_Loop__File() _Check_Local_In_Loop__Folder () Using functions: _Check_Local_In_Loop__File() You can specify a single file *. Au3 file will be checked for using the keyword "Local" inside the Loop Statements According to the used parameters the result will be send to SciTE console, Clipboard, eventualy displayed using _ArrayDisplay(). Using functions: _Check_Local_In_Loop__Folder () You can specify the folder containing the files *. Au3 All files in the given directory will be subject to analysis like above. The use of parameters, the internal functions: _Check_Local_In_Loop_Check_File ($ HFile, $ fArrayDisplay = True) additionally determines the manner of presenting the results of the work of this script. First Version 2013/12/03 02:00 AM EXAMPLE 1: Run that script in Current Beta: AutoIt 3.3.9.23 select Au3 file for example: array.au3 (from include AutoIt 3.3.9.23) results: Row |Col 0 0|While 1 1|Local $aiCurItems[1] = [0] 2|Local $aiCurItems[1] = [0] Explanation: Open this file in SciTE.exe and search text: Local $aiCurItems[1] = [0] You'll notice that this text is inside: While 1 EXAMPLE 2: Run that script in Current Beta: AutoIt 3.3.9.23 select Au3 file for example: ie.au3 (from include AutoIt 3.3.9.23) results: Row |Col 0 0|For $o_window In $o_ShellWindows 1|Local $f_found = False 2|Local $f_found = False Explanation: Open this file in SciTE.exe and search text: Local $f_found = False You'll notice that this text is inside: For $o_window In $o_ShellWindows EXAMPLE 3: Run that script in Current Beta: AutoIt 3.3.9.23 select Au3 file for example: GuiListView.au3 (from include AutoIt 3.3.9.23) results: Row |Col 0 0|For $i = 0 To $items - 1 1|Local $a_indices[2] 2|Local $a_indices[2] Explanation: Open this file in SciTE.exe and search text: Local $a_indices[2] You'll notice that this text is inside: For $i = 0 To $items - 1 EXAMPLE 4: Run that script in Current Beta: AutoIt 3.3.9.23 select Au3 file for example: array.au3 (from include AutoIt 3.3.8.1) results: Row |Col 0 0|While 1 1|Local $sClip = "" Local $aiCurItems[1] = [0] 2|Local $aiCurItems[1] = [0] Row |Col 0 0|For $x = 1 To 255 1|Local $sFind = _ArraySearch($avArray, Chr($x), 0, 0, 0, 1) 2|Local $sFind = _ArraySearch($avArray, Chr($x), 0, 0, 0, 1) Explanation: Open this file in SciTE.exe and search text: Local $sClip = "" Local $aiCurItems[1] = [0] You'll notice that this text is inside: While 1 search text: Local $sFind = _ArraySearch($avArray, Chr($x), 0, 0, 0, 1) You'll notice that this text is inside: For $x = 1 To 255 Version 2013/12/03 05:34 PM _Check_Local_In_Loop__Folder() ---> FileSelectFolder () parameter $fArrayDisplay = True parameter $fReturnAsString = False Version 2013/12/04 01:42 AM removed parameter $fReturnAsString added output to SciTE console removed not needed info from SciTE console Fixed problem with Loop statements on the begining of script added option (MsgBox) to choose "File or Folder" added option (MsgBox) to choose "Open file" see attached au3 file !!! NEW Version 2013/12/05 01:40 AM added checking for Global Dim and Static some other modyfication in REGEXP pattern see attached: BestCodingPractice_Analyzer__Version_20131205_0140_AM.zip BestCodingPractice_Analyzer.au3 BestCodingPractice_Analyzer__Version_20131205_0140_AM.zip
- 47 replies
-
- BestCodingPractice
- Local
-
(and 1 more)
Tagged with: