Comment it– QTP
Rem statement is used for commenting your code in QTP.
As per the QTP help file:
Rem comment
-or-
‘ comment
The comment argument is the text of any comment you want to include. After the Rem keyword, a space is required before comment.
Remarks
As shown in the syntax section, you can use an apostrophe (‘) instead of the Rem keyword. If the Rem keyword follows other statements on a line, it must be separated from the statements by a colon. However, when you use an apostrophe, the colon is not required after other statements.
I tried using the Rem statement without using the colon and it worked fine. I am using QTP 10.0.
Dim MyStr0,MyStr1, MyStr2
MyStr0=”Mr” : Rem Comment after a statement separated by a colon.
MyStr1 = “Pavan” Rem Comment after a statement not separated by a colon.
MyStr2 = “learning QTP” ‘ This is also a comment; no colon used
Rem Comment on a line with no code; no colon is needed.
Msgbox MyStr0
Msgbox MyStr1
Msgbox MyStr2
June 12, 2010