Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
399 views
in Technique[技术] by (71.8m points)

QTP/UFT - Adding comments to code in Editor view

How do I add comments in my code via the Editor view for my Actions? I know this is a simple question, but I haven't been able to figure it out, and this seems almost impossible to Google for.

I've tried some of the standard commenting types, none of which have worked:

  • //
  • /* */
  • #
  • --

I know I can add text to the Description attribute for an Action, but I'd like to be able to comment out specific lines in my code as needed.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do you mean the expert view where you see the generated code?
You can use the single quote character for that:

' The user needs to be informed that the test is ready to run, so 
' he can take appropriate actions before continue or Cancel if needed.
If MsgBox("The test is ready to start.", VbOKCancel) <> VbOK then
    ExitTest
End If

Shortcut to comment/uncomment blocks: Ctrl+M and Ctrl+Shift+M


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...