Jump to content

Hack that tells you what line# a compiled script actually crashed on...


JockoDundee
 Share

Recommended Posts

I came across a few discussions recently where people were complaining about how the error message for a compiled script gives a line number that is different from the interpreter, and generally not helpful.

A while back I created this super janky hack because I had few compiled scripts that would unexpectedly crash, and needed sometimes to figure out the line number.

So, here it is.  You just start it, it runs in the background, and if any .exe error messages should come up, it replaces the line number on the fly. If you blink you might miss it.  Ctrl-Shift q to exit.  
There are a couple assumptions made, 

1. Include statements should be at the top of the file.  
2. The source file must be in the same directory as the .exe    
3. The Autoit compiler must be installed.

I’ve only tested it with my files and standard autoit includes, there may be a few holes I’m not aware of, so let me know what problems are found.

#pragma compile(Console, True)

HotKeySet("^+q", "exitfunc")
ConsoleWrite("ErrMsgHack Starting... Ctrl-Shift-q to Quit" & @CRLF) 
ToolTip("Ctrl-Shift-q To Quit")
Sleep(2000)
ToolTip("")
WinActivate("[TITLE:AutoIt Error]","")

Local $hErrWin, $hRefWin, $fhInput, $fhOutput 
Local $sErrorText, $sSourceFile, $sOutFileName
Local $iErrLineNo, $iRefLineNo, $iLinesRead

While True

   If WaitForExeError() Then
      If CreateRefFile() Then
         CompileAndRunRefFile() 
         WaitForRefExeError()
         CalculateOffset()
         UpdateExeError()
      EndIf
   EndIf

WEnd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func WaitForExeError()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$hErrWin=WinWaitActive("[TITLE:AutoIt Error]","")
$sErrorText=ControlGetText($hErrWin,"",65535)
If StringInStr($sErrorText, ".exe") Then
   $iErrLineNo=StringSplit($sErrorText," ",2)[1]
   $sSourceFile=StringSplit($sErrorText,'"',2)[1]
   $sSourceFile=StringReplace($sSourceFile, ".exe", ".au3")
   $sErrorText=StringSplit($sErrorText,"Error:",1)[2]
   Return True
Else
   Sleep(2000)
   Return False
EndIf

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func CreateRefFile()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Local $sLine="" , $bIncludeFound=False

$sOutFileName="_E_FD_"
$fhInput=FileOpen($sSourceFile)
$fhOutput=FileOpen($sOutFileName &".au3",2)

If $fhInput=-1 Then Return False

While True
   $sLine=FileReadLine($fhInput)
   If @error=-1 Then ExitLoop
   $sLine=StringStripWS($sLine,8)
   If StringLeft($sline,8)="#include" Then
      FileWriteLine($fhOutput, $sLine)
      $bIncludeFound=True
   ElseIf $sline="" Then
   Else
      ExitLoop 
   EndIf
WEnd
   
If Not $bIncludeFound Then Return False

FileWriteLine($fhOutput, "[[[")
FileClose($fhOutput)

Return True 

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func CompileAndRunRefFile()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RunWait(@ProgramFilesDir &"\AutoIt3\Aut2Exe\Aut2exe.exe /in "& $sOutFileName &".au3")

Run($sOutFileName &".exe")

WinWaitNotActive($hErrWin,"", 5)

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func WaitForRefExeError()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$hRefWin=WinWaitActive("[TITLE:AutoIt Error]","")
$sText=ControlGetText($hRefWin,"",65535)
$iRefLineNo=StringSplit($sText," ",2)[1]
ControlSend($hRefWin, "","","{ENTER}")

Sleep(100)
   
FileDelete($sOutFileName &".au3")
FileDelete($sOutFileName &".exe")

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func CalculateOffset()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Local $iCnt=$iRefLineNo, $bInComment=False, $sLine="" 

$iLinesRead=0

FileClose($fhInput)
$fhInput=FileOpen($sSourceFile)

While True
   $sLine=FileReadLine($fhInput)
   If @error=-1 Then ExitLoop
   $sLine=StringStripWS($sLine,8)
   $iLinesRead+=1
   $stok=StringLeft($sLine,3)
   If $stok="#cs" Then 
      $bInComment=True
   ElseIf $stok="#ce" Then
      $bInComment=False
   EndIf
   If $sLine="" Or StringLeft($sLine,1)="#" Or StringLeft($sLine,1)=";" Or StringRight($sLine, 1)="_" Or $bInComment Then 
   Else
      If $iCnt=$iErrLineNo Then
            ExitLoop
      EndIf
      $iCnt+=1
   EndIf
WEnd

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func UpdateExeError()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

If $iRefLineNo>$iErrLineNo Then
   $sErrorText="Error is in #include file(s) Line "& $iErrLineNo &"):"& @CRLF & @CRLF &"Error:"& $sErrorText
Else
   $sErrorText="Line " &" "& $iLinesRead &" (File "& $sSourceFile &"):"& @CRLF & @CRLF &"Error:"& $sErrorText
EndIf
ControlSetText($hErrWin,"",65535, $sErrorText)

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func ExitFunc()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ConsoleWrite("ErrMsgHack Unloading..." & @CRLF) 

Exit

EndFunc

Here’s a video that demonstrates the way I use it.:

https://youtu.be/qA-DKqwt5Ss

If you prefer no real time error message boxes but instead errors displayed on the console, take a look at (minimally tested, using libs from others) ..

 

Edited by JockoDundee
added some error checking - added video - fixed UTF-8 BOM problem

Code hard, but don’t hard code...

Link to comment
Share on other sites

much more better solution was provided by @trancexx here:

 

 

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

I Focus on That you have of Waiting for Windows with autoit error.

Personally i use an combination of Au3Stripper /rsln  /mo + @trancexx solution.

 

Edited by mLipok
/rsln not /rpln

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

Hmmm.... as far as I create reproducer and @Jos fix Au3Stripper about 4 year ago.....

No.

EDIT:  7years ago
https://www.autoitscript.com/trac/autoit/ticket/2524

 

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

51 minutes ago, mLipok said:

Hmmm.... as far as I create reproducer and @Jos fix Au3Stripper about 4 year ago.....


Thanks for the information. Yes, I see now this was fixed by @Jos.

However I still have a question, you described the process with Au3stripper here:

Is this the most current guidance?

This work on stripper is invaluable but is not wholly satisfactory to me because of the back and forth nature of the process you describe in 2017.

Although it’s informational, my situation is that I usually write for stdin stdout so I need to compile with #pragma compile(Console, True), and therefore I am not usually using the interpreter during dev.
Also, I make a lot of mistakes; This deadly combination means I would be x-reffing errors constantly :)

So that is why I wrote something to make it almost seamless, as if you were using the interpreter.

I also have no illusions to its stature, as I cleared defined it as a “super janky” hack. If there is something that does the same thing, I’m all for it!

So are you saying that you now are using this with an integrated @trancexx message interceptor to provide the correct line number in real-time to the error window?

If so, is it publicly available?

Thanks for your insights.

 

Code hard, but don’t hard code...

Link to comment
Share on other sites

  • Developers
3 minutes ago, JockoDundee said:

So that is why I wrote something to make it almost seamless, as if you were using the interpreter.

Which part isn't seamless when using AutoIt3Wrapper & Au3Stripper when compiling?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

18 minutes ago, JockoDundee said:

Also, I make a lot of mistakes; This deadly combination means I would be x-reffing errors constantly :)

me too.

18 minutes ago, JockoDundee said:

So are you saying that you now are using this with an integrated @trancexx message interceptor to provide the correct line number in real-time to the error window?

@trancexx soultions in my case is used translate the error message and to make logs from such cases, and have nothing to do with providing the correct line number.
But you can catch the line number and redirect them to console using ConsoleWrite().

But the window will pop up in the end....
Maybe @trancexx have or may provide solution, to catch the text, redirect them to another output (already easy to do), and do not show this MsgBox at all (currently I do not know how to omnit displaying this specific window)

 

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

21 minutes ago, JockoDundee said:

So are you saying that you now are using this with an integrated @trancexx message interceptor to provide the correct line number in real-time to the error window?
If so, is it publicly available?

it is publicly available from this 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

7 hours ago, Jos said:

Which part isn't seamless when using AutoIt3Wrapper & Au3Stripper when compiling?

Jos

Jos, I mean to cast no aspersions towards the Wrapper, nor the Stripper, although I have not used them extensively they appear useful. 
My target problem is much narrower, though still a pain point.  Let me explain a little about my current projects.

I have been using autoit to write Unix like utilities running under bash/WSL for windows.  As you can imagine, using the input output streams is of primary significance.  Therefore my programs don’t “work” without being compiled as such*.

So I am typically developing  jobs that run from the command line in a bash shell.  Anyway, as you might imagine I get more than a few runtime errors; these typically have the incorrect line number in them.

Note that I am NOT speaking about the related issue of @Scriptlinenumber being off; I am talking about the unstoppable (IFAIK) run time errors, such as array bounds etc.  So this is what I wrote to get the correct line number at run time, even without preprocessing.  I made a short video to illustrate:

 

I have looked thru what both you and @mLipok have referenced, but I fail to find this exact functionality.

Timeline:

0:02 Start the ErrMsgHack job in the background

0:16 Compile an example job using stdio 

0:25 Run the example job, intentionally created with an array subscript error

0:31 After running a few seconds, job crashes with an autoit error, line number is thousands too high.

0:32 The background job kicks in and calculated the correct line no and changes the error pop up.

0:45 I use the new error line number to inspect the code in the source.

It may not seem like a lot, but it certainly has saved me a lot of time.  I gathered that other people also would benefit from it based on other discussions.  But if this is already solved, I don’t wish to add any confusion.

Thanks for your time.

*If you were to tell me I am wrong about this, I would be elated!

Code hard, but don’t hard code...

Link to comment
Share on other sites

7 hours ago, mLipok said:

it is publicly available from this post:

 

 

If I’m not mistaken, this is in part a fix for the related @SCRIPTLINENUMBER issue.  Unfortunately, I am not talking about my own error boxes but rather the unforeseen runtime ones of which I have no control* I posted a video up above, and would like to know what you think.

*Except to not make errors in the first place, of course.

Code hard, but don’t hard code...

Link to comment
Share on other sites

Autoit is pretty stable on its own.  I've had programs run for days or weeks without issue.  If you're getting array subscript errors its most likely going out of bounds on some edge case scenario that you've over looked.  These can generally be avoided with good array management. 

Link to comment
Share on other sites

4 hours ago, markyrocks said:

Autoit is pretty stable on its own.  I've had programs run for days or weeks without issue.

Sure. 

4 hours ago, markyrocks said:

If you're getting array subscript errors its most likely going out of bounds on some edge case scenario that you've over looked.

No doubt.  To be clear, there is little question about the source of these errors, it’s me.

4 hours ago, markyrocks said:

These can generally be avoided with good array management. 

Do you ever get runtime errors yourself?  
Maybe you don’t declare a variable - or you don’t terminate a string - or call a function with the wrong arguments etc?

In fact, if I’m writing code for hours on end without running anything, I am almost guaranteed to have some syntax error somewhere, when I first run the new version.  Does this not happen to you?

Also, do you use the Aut2exe compiler to compile your programs?

If you do use it and if you ever had a run-time error then you might have noticed that the error line# shown in the error pop-up  is almost certainly different from the line of source that actually caused it.

That’s what this discussion is mainly about

Code hard, but don’t hard code...

Link to comment
Share on other sites

  • Developers
6 hours ago, JockoDundee said:

It may not seem like a lot, but it certainly has saved me a lot of time.

Thanks for your elaborate reply, but not sure how that answers my simple question? :) 

Just make SciTE run Au3stripper with each compile and use option mergeonly to merge the files for you into one file, then when you get an error with your compiled script you look at the scriptname_stripped.au3 version of the source and see the correct line at the indicated error linenr. ;) 

Simple example:
Script test.au3 -> F7:

#Au3Stripper_Parameters=/mo
#AutoIt3Wrapper_Run_Au3Stripper=y
#include <GUIConstantsEx.au3>
dim $aArray[1] = [8]
$A = $aArray[1]

Run test.exe->Error & test_stripped.au3:
1556724995_Schermafbeelding2020-11-06101547.jpg.a5273facb9dbbedc6db63c8389516f34.jpg

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

9 hours ago, Jos said:

Just make SciTE run Au3stripper with each compile and use option mergeonly to merge the files for you into one file, then when you get an error with your compiled script you look at the scriptname_stripped.au3 version of the source and see the correct line at the indicated error linenr

Does this work if compiling to a3x? I just tried it after compiling a3x script, but the stripped.au3 is not created 🤔

Link to comment
Share on other sites

  • Developers
6 minutes ago, dmob said:

Does this work if compiling to a3x? I just tried it after compiling a3x script, but the stripped.au3 is not created 🤔

Sure ...why not? au3stripper still runs and the x_stripped.au3 source is used to create the a3x file.
Can you show me the SciTE ouputpane info from your compile to a3x?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

On 11/6/2020 at 12:48 AM, Jos said:

Thanks for your elaborate reply, but not sure how that answers my simple question?

Just for reference your simple question was:

On 11/5/2020 at 10:56 AM, Jos said:

Which part isn't seamless when using AutoIt3Wrapper & Au3Stripper when compiling?

Nothing, “when using...and when compiling”.  There are a few “seams”, (albeit minor)  when getting to the actual error.

To put it in perspective, let’s take development in SciTe, if you encounter a run time error, you are taken right to the offending line, where you can fix it.  
So I rate SciTe at 0 seams.

With a compiled script with a stripped.au3, when you encounter a run-time error, the process starts with opening another file for browsing, going to the line number, examine the line, and then navigating to the same line in your source.  
Although in the majority of cases, nothing more than seeing the errant line in the stripped code will be enough to inform you of the corresponding source code, this is not always the case, since the stripped code surrounding the errant line is whitespace compressed, and therefore may not readily be identifiable on sight.  
Searching an exact string directly therefore may be necessary. Further complicating matters is the fact that even this method is non-deterministic; due to fact the source code often contains duplicate lines, e.g. Return $iRet, requiring further investigation.  In addition, in my case at least, using the stripper will be off by the number of #pragmas in my source.

So I rate the Stripper /rsln method of error reconciliation at 2-3 seams.

With my method, when you encounter a compiled script run-time error, an error message comes up with the standard information in the pop-up but with the actual line number of the error right there.  Then you open the file to that line.  My method also is not affected by pragma statements, nor does it rely on the #include files.

So I rate my method at 1 seam.

In conclusion, I would say that the stripper method is quite workable, and had I been aware of it I probably would be using it now.  However, for a CLI developer even small inefficiencies add up; I type at a rate of around 2-3 EPM (errors per minute), so it’s a repetitive task worth improving for me.  I offer up the script only after seeing the selflessness of others, like you, in donating their efforts.

J.

Edited by JockoDundee
It absolutely does require include files.

Code hard, but don’t hard code...

Link to comment
Share on other sites

I take a look again in this following awesome @trancexx example:

 

and here you go... an CUI example with no AutoIt Erorr MsgBox:

;~ https://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/?tab=comments#comment-1111917
;~ https://www.autoitscript.com/forum/topic/204311-hack-that-tells-you-what-line-a-compiled-script-actually-crashed-on/

#AutoIt3Wrapper_Run_Au3Stripper=Y
#Au3Stripper_Parameters=/rsln /mo

#AutoIt3Wrapper_Change2CUI=Y
#include <WinApi.au3>
#include <StringConstants.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
AddHookApi("user32.dll", "MessageBoxW", "Intercept_MessageBoxW", "int", "hwnd;wstr;wstr;uint")

_Example()
Func _Example() ; mLipok example
    Local $aTest[0]
    ConsoleWrite("! " & $aTest[2] & @CRLF)
EndFunc   ;==>_Example

Func Intercept_MessageBoxW($hWnd, $sText, $sTitle, $iType)

    Local $aOutput = StringRegExp($sText, '(?i)Line\s+(\d+)', $STR_REGEXPARRAYGLOBALMATCH)
    If @error Then Return

    ConsoleWrite(@ScriptName & ' - !!! Error occured in line #' & $aOutput[0] & @CRLF)
    Return ; mLipok mod omnit MsgBox because of CUI=Y

    Local $aCall = DllCall("user32.dll", "int", "MessageBoxW", _
            "hwnd", $hWnd, _
            "wstr", $sText, _
            "wstr", StringReplace($sTitle, "AutoIt", @ScriptName), _
            "uint", $iType)
    If @error Or Not $aCall[0] Then Return 0
    Return $aCall[0]
EndFunc   ;==>Intercept_MessageBoxW

; The magic is down below
Func AddHookApi($sModuleName, $vFunctionName, $vNewFunction, $sRet = "", $sParams = "")
    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)
    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)
    ; 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
    ; 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

 

image.png.67b73b3b55da04d2056014b1ee6a12b5.png

image.png.49980107798d59186924f437716852f4.png

Edited by mLipok
added #AutoIt3Wrapper_Run_Au3Stripper=Y #Au3Stripper_Parameters=/rsln /mo

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...