人生的意义,在人生之外,就如同工作的意义,在工作之外。
Cherish the people you meet everyday
VBScript何时用括号
上一篇 /
下一篇 2010-06-02 15:39:43
/ 个人分类:QTP
When programming in VBScript, it is important that you follow the rules for using or not using parentheses () in your statements.
`9I G7L i?8a0You must use parentheses around method arguments if you are calling a method that returns a value and you are using the return value. For example, use parentheses around method arguments if you are returning a value to a variable, if you are using the method in anIfstatement, or if you are using theCallkeyword to call an action. You also need to add parentheses around the name of a checkpoint if you want to retrieve its return value.
1mZ{ i7G+},HW0W;G0Tip: If you receive anExpected end of statementerror message when running a step in your test, it may indicate that you need to add parentheses around the arguments of the step's method.
MkeL;RL0The following examples show when to use or not use parentheses.
'F"n*W3m-]M%k'G@0The following example requires parentheses around method arguments, since it returns a value to a variable:
PGN!`V8y*TN0Set WebEditObj = Browser("Mercury Tours").Page("Method of Payment").WebTable("FirstName").ChildItem (8, 2, "WebEdit", 0)
%u!`_f:m3\8["]i0WebEditObj.Set "Example"
z3OEU3P&Lb4Y5r0The following example requires parentheses around method arguments, sinceCallis being used: