Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
401 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...