问题描述
如何在我的操作的编辑器视图中的代码中添加注释?我知道这是一个简单的问题,但我还没有能够弄清楚,这似乎几乎不可能谷歌的。
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:
-
//
li>
-
/ * * /
-
#
-
-
//
/* */
#
--
我知道我可以添加文本到一个Action的描述属性,但我想能够在需要的时候注释掉我的代码中的特定行。
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.
推荐答案
您是指看到生成的代码的专家视图吗?
您可以使用单引号字符:
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
注释/取消注释块的快捷键:Ctrl + M和Ctrl + Shift + M
Shortcut to comment/uncomment blocks: Ctrl+M and Ctrl+Shift+M
这篇关于QTP / UFT - 在编辑器视图中向代码添加注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!