Comment it– QTP

Posted On June 12, 2010

Filed under QTP

Comments Dropped leave a response

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

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.