LATEST UPDATES
ShareHolder Finder v0.9.3 is now released!!! Check Product Page for more details.
✉ info@automationdevelopers.com

ITS ALL ABOUT AUTOMATION

Saturday, 13 February 2016

AutoIt - Add Comments in script


Author Post Date Saturday, 13 February 2016
Comments are the best method to provide more information to script readers. Also we can comment-out the unwanted code parts for later use. The comments are ignored by the script compiler.
We have two methods to add comments in script - Line comment and Block comment.
Line comment: The semicolon (;) is the comment character and all the text in the line after semicolon is ignored by the script compiler; unless it is within a string.
Block comment: It is used to comment a section of script. The keywords are, #comments-start to start the comment and #comments-end to end the comment. Abbreviated keywords #cs and #ce also can be used.
Examples are provided below.

; Display a message box
MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 1")

#comments-start
 MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 2")
 MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 3")
#comments-end

MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 4"); Display another message box

#cs
 MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 5")
 MsgBox($MB_ICONINFORMATION, "Automation Developers", "Message Box - 6")
#ce

Related Posts




Interesting? Share and Let Others Know.

Post a Comment