Jump to content

BestCodingPractice Analyzer ;)


mLipok
 Share

Recommended Posts

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

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
#AutoIt3Wrapper_Version=B
#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include <array.au3>



_Check_Local_In_Loop()
Func _Check_Local_In_Loop()
    Local $hFile = FileOpenDialog('Select Au3 file to check', @ScriptDir, 'AutoIt3 Files (*.au3)', $FD_FILEMUSTEXIST)
    Local $sFileContent = FileRead($hFile)

    Local $sTextToFind = _Local_inside_Loop($sFileContent)
    Local $fContinue_EndFunc, $fContinue_Local, $fContinue_Wend, $fContinue_Until, $fContinue_Next
    Do
        ConsoleWrite(@CRLF)
        $fContinue_EndFunc = _Remove_Func_EndFunc($sTextToFind)
        $fContinue_Local = _Remove_Func_Local($sTextToFind)
        $fContinue_Wend = _Remove_While_Wend($sTextToFind)
        $fContinue_Until = _Remove_DO_UNTIL($sTextToFind)
        $fContinue_Next = _Remove_For_Next($sTextToFind)
    Until $fContinue_EndFunc = False And $fContinue_Local = False And $fContinue_Wend = False And $fContinue_Until = False And $fContinue_Next = False
;~  ClipPut($sTextToFind)
;~  MsgBox(1, 'Result', $sTextToFind)
    Local $sREGEXP = ''

    $sREGEXP = '(?i)(While .*\r\n)((Local .*\r\n)+)'
    Local $aWhileWend = StringRegExp($sTextToFind, $sREGEXP, 3)
    _ArrayDisplay($aWhileWend, '$aWhileWend')

    $sREGEXP = '(?i)(Do\r\n|Do \;\V*\r\n)((Local .*\r\n)+)'
    Local $aDoUntil = StringRegExp($sTextToFind, $sREGEXP, 3)
    _ArrayDisplay($aDoUntil, '$aDoUntil')

    $sREGEXP = '(?i)(For .*\r\n)((Local .*\r\n)+)'
    Local $aForNext = StringRegExp($sTextToFind, $sREGEXP, 3)
    _ArrayDisplay($aForNext, '$aForNext')

EndFunc   ;==>_Check_Local_In_Loop

Func _Local_inside_Loop($sTEXT)
    Local $sREGEXP = '(?is)(?<=\r\n)(?:\s*?)(Func \V*|EndFunc\V*|While \V*|Wend\V*|Do(?=\r\n)|Do \;\V*|Until \V*|For \V*|Next\V*|Local \V*)'
    Local $aTEXT = StringRegExp($sTEXT, $sREGEXP, 3)
    Return _ArrayToString($aTEXT, @CRLF)
EndFunc   ;==>_Local_inside_Loop

Func _Remove_Func_EndFunc(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Func \V*\r\n)(EndFunc\V*\r\n)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_Func_EndFunc $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc   ;==>_Remove_Func_EndFunc

Func _Remove_Func_Local(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Func .*\r\n)((Local .*\r\n)+)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '$1')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_Func_Local $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc   ;==>_Remove_Func_Local

Func _Remove_While_Wend(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(While \V*\r\n)(Wend\V*\r\n)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_While_Wend $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc   ;==>_Remove_While_Wend

Func _Remove_DO_UNTIL(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Do\r\n|Do \;\V*\r\n)(Until \V*\r\n)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_DO_UNTIL $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc   ;==>_Remove_DO_UNTIL

Func _Remove_For_Next(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(For \V*\r\n)(Next\V*\r\n)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_For_Next $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc   ;==>_Remove_For_Next



 
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

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
#AutoIt3Wrapper_Version=B
#include <MsgBoxConstants.au3>
#include <File.au3>
#include <FileConstants.au3>
#include <array.au3>



;~ _Check_Local_In_Loop()
_Check_Local_In_Loop__Folder()

Func _Check_Local_In_Loop()
    Local $hFile = FileOpenDialog('Select Au3 file to check', @ScriptDir, 'AutoIt3 Files (*.au3)', $FD_FILEMUSTEXIST)
    _Check_Local_In_Loop_Check_File($hFile)
EndFunc ;==>_Check_Local_In_Loop

Func _Check_Local_In_Loop__Folder()
    Local $hFile = FileSelectFolder('Select folder with Au3 file to check', '', 4)
    Local $aAu3Files = _FileListToArray($hFile, '*.au3', 1, True)
    Local $sTextTemp = ''
    Local $sTextOut = ''
    For $File In $aAu3Files
        $sTextTemp = _Check_Local_In_Loop_Check_File($File, False, True)
        If $sTextTemp <> '' Then
            $sTextOut &= '======================================================' & @CRLF
            $sTextOut &= $File & @CRLF
            $sTextOut &= '======================================================' & @CRLF
            $sTextOut &= $sTextTemp
            $sTextOut &= '------------------------------------------------------' & @CRLF
        EndIf
    Next
    ClipPut($sTextOut)
    MsgBox(1, 'Result', $sTextOut)
EndFunc ;==>_Check_Local_In_Loop__Folder

Func _Check_Local_In_Loop_Check_File($hFile, $fArrayDisplay = True, $fReturnAsString = False)
    Local $sFileContent = FileRead($hFile)
    Local $sFileName = StringRegExpReplace($hFile, '.*', '')


    Local $sTextToFind = _Local_inside_Loop($sFileContent)
    Local $fContinue_EndFunc, $fContinue_Local, $fContinue_Wend, $fContinue_Until, $fContinue_Next
    Do
        ConsoleWrite(@CRLF)
        $fContinue_EndFunc = _Remove_Func_EndFunc($sTextToFind)
        $fContinue_Local = _Remove_Func_Local($sTextToFind)
        $fContinue_Wend = _Remove_While_Wend($sTextToFind)
        $fContinue_Until = _Remove_DO_UNTIL($sTextToFind)
        $fContinue_Next = _Remove_For_Next($sTextToFind)
    Until $fContinue_EndFunc = False And $fContinue_Local = False And $fContinue_Wend = False And $fContinue_Until = False And $fContinue_Next = False
;~     ClipPut($sTextToFind)
;~     MsgBox(1, 'Result', $sTextToFind)
    Local $sREGEXP = '', $sTextOut = ''


    $sREGEXP = '(?i)(While .*rn)((Local .*rn)+)()'
    Local $aWhileWend = StringRegExp($sTextToFind, $sREGEXP, 3)
    If $fArrayDisplay = True Then _ArrayDisplay($aWhileWend, '$aWhileWend , $sFileName: ' & $sFileName)
    If $fReturnAsString = True Then $sTextOut &= _ArrayToString($aWhileWend, @CRLF)

    $sREGEXP = '(?i)(Dorn|Do ;V*rn)((Local .*rn)+)()'
    Local $aDoUntil = StringRegExp($sTextToFind, $sREGEXP, 3)
    If $fArrayDisplay = True Then _ArrayDisplay($aDoUntil, '$aDoUntil , $sFileName: ' & $sFileName)
    If $fReturnAsString = True Then $sTextOut &= _ArrayToString($aDoUntil, @CRLF)

    $sREGEXP = '(?i)(For .*rn)((Local .*rn)+)()'
    Local $aForNext = StringRegExp($sTextToFind, $sREGEXP, 3)
    If $fArrayDisplay = True Then _ArrayDisplay($aForNext, '$aForNext , $sFileName: ' & $sFileName)
    If $fReturnAsString = True Then $sTextOut &= _ArrayToString($aForNext, @CRLF)

    Return SetError(1, 0, $sTextOut)
EndFunc ;==>_Check_Local_In_Loop_Check_File

Func _Local_inside_Loop($sTEXT)
    Local $sREGEXP = '(?is)(?<=rn)(?:s*?)(Func V*|EndFuncV*|While V*|WendV*|Do(?=rn)|Do ;V*|Until V*|For V*|NextV*|Local V*)'
    Local $aTEXT = StringRegExp($sTEXT, $sREGEXP, 3)
    Return _ArrayToString($aTEXT, @CRLF)
EndFunc ;==>_Local_inside_Loop

Func _Remove_Func_EndFunc(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Func V*rn)(EndFuncV*rn)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_Func_EndFunc $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc ;==>_Remove_Func_EndFunc

Func _Remove_Func_Local(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Func .*rn)((Local .*rn)+)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '$1')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_Func_Local $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc ;==>_Remove_Func_Local

Func _Remove_While_Wend(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(While V*rn)(WendV*rn)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_While_Wend $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc ;==>_Remove_While_Wend

Func _Remove_DO_UNTIL(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(Dorn|Do ;V*rn)(Until V*rn)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_DO_UNTIL $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc ;==>_Remove_DO_UNTIL

Func _Remove_For_Next(ByRef $sText)
    Local $fReturn_IsNotComplex = True
    Local $sREGEXP = '(?i)(For V*rn)(NextV*rn)'
    $sText = StringRegExpReplace($sText, $sREGEXP, '')
    If @error = 0 And @extended = 0 Then $fReturn_IsNotComplex = False
    ConsoleWrite('_Remove_For_Next $fReturn_IsNotComplex = ' & $fReturn_IsNotComplex & @CRLF)
    Return $fReturn_IsNotComplex
EndFunc ;==>_Remove_For_Next
 

 

 

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

Edited 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Not at all. But partially yes :)

EDIT: spelling

Edited 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Hi Mlipok,

 

             Nice Idea. may i know from where i can download MsgBoxConstants.au3 file?

 

yes of course

http://www.autoitscript.com/forum/files/file/267-autoit-v33923-beta/

HINT: you must install and in SciTE use ALT+F5 or ALT+F7

 

ps.

I'm glad you like it

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

  • Moderators

Syed23,

If you do not want to install the Beta, just use Constants.au3 with 3.3.8.1. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thank you so much Melba23 that worked very well.

Milpok i tried with Melba23 idea and the code works very nice... this is really good... 

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

!!! NEW Version 2013/12/03 05:34 PM

  • _Check_Local_In_Loop__Folder()    ---> FileSelectFolder ()
  • parameter $fArrayDisplay = True
  • parameter $fReturnAsString = False

 

Please check in the opening post.

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Please don't use spoiler tags, just upload the file instead as I am confused as to which one I should use. Anyway, I ran your code with this and if reported nothing in the console.

While 1
    Local $fTest = True
    ConsoleWrite($fTest & @CRLF)
WEnd

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

 

Please don't use spoiler tags, just upload the file instead as I am confused as to which one I should use. Anyway, I ran your code with this and if reported nothing in the console.

While 1
    Local $fTest = True
    ConsoleWrite($fTest & @CRLF)
WEnd

 

Did you expect the result to the console.

Currently, the program displays the MsgBox and sends the results to the clipboard.
 
If you think that the option with the console is more preferred, of course, it will introduce.
The more that I'm working on further amendments.
 
 
Referring to the example:
;add any line before loop statement
While 1
    Local $fTest = True
    ConsoleWrite($fTest & @CRLF)
WEnd

I think it's quite logical that, in most cases, the script does not begin by calling the loop.

 

edit:

'Please don't use spoiler tags, just upload the file instead"

Ok I change this at the next opportunity / amendment.

Edited 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Who is to say what's logical about just jumping straight to a loop? There's nothing to prevent it, or anything that would say it's wrong to do it. Your script should recognize this.

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 Gude
How 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

I think I need clearer instructions on how to use then, because I just tried with your second spoiler tag code and it produced a message box with no data and this in the console. The clipboard was also empty. I chose the desktop where my test Au3 Script from above was present.

_Remove_Func_EndFunc $fReturn_IsNotComplex = False
_Remove_Func_Local $fReturn_IsNotComplex = False
_Remove_While_Wend $fReturn_IsNotComplex = False
_Remove_DO_UNTIL $fReturn_IsNotComplex = False
_Remove_For_Next $fReturn_IsNotComplex = False

_Remove_Func_EndFunc $fReturn_IsNotComplex = True
_Remove_Func_Local $fReturn_IsNotComplex = True
_Remove_While_Wend $fReturn_IsNotComplex = False
_Remove_DO_UNTIL $fReturn_IsNotComplex = True
_Remove_For_Next $fReturn_IsNotComplex = True

_Remove_Func_EndFunc $fReturn_IsNotComplex = True
_Remove_Func_Local $fReturn_IsNotComplex = False
_Remove_While_Wend $fReturn_IsNotComplex = False
_Remove_DO_UNTIL $fReturn_IsNotComplex = False
_Remove_For_Next $fReturn_IsNotComplex = False

_Remove_Func_EndFunc $fReturn_IsNotComplex = False
_Remove_Func_Local $fReturn_IsNotComplex = False
_Remove_While_Wend $fReturn_IsNotComplex = False
_Remove_DO_UNTIL $fReturn_IsNotComplex = False
_Remove_For_Next $fReturn_IsNotComplex = False

_Remove_Func_EndFunc $fReturn_IsNotComplex = False
_Remove_Func_Local $fReturn_IsNotComplex = False
_Remove_While_Wend $fReturn_IsNotComplex = False
_Remove_DO_UNTIL $fReturn_IsNotComplex = False
_Remove_For_Next $fReturn_IsNotComplex = False

Perhaps in your first post you should be concise as to what this analyzer does, maybe a small example of what it's expected to report to the user. 

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

In the next few hours I'll update the script and description.

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

In the next few hours I'll update the script and description.

Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

!!! NEW 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 file in opening post

btw.

I made a new entry to the description.

Tomorrow even sort out the examples and way of describing version.

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Am I the only one who can't see any attached file?

No, I can't either.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I'm sorry for all concerned.
The file can be downloaded already.

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

Erroneous declarations are really just the tip of the iceberg. People don't always agree on what is, or isn't, good coding practice. I'm not dismissing your idea because it may have potential in terms of teaching AutoIt basics.

I also see the logic of your example: I can't think of any reason why someone would want to decalre a variable* within a loop other than to test the interpreter in some way. A  distinction should be made between that which is clearly wrong and that which is mostly a matter of opinion.

* the same variable

Edited by czardas
Link to comment
Share on other sites

I always considered Tidy a best coding practice analyzer.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...