QTP/UFT - Adding comments to code in Editor view

為{幸葍}努か 提交于 2019-12-13 09:08:20

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/19640531/qtp-uft-adding-comments-to-code-in-editor-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!