51Testing软件测试论坛

标题: 请教TSL代码的问题. [打印本页]

作者: rantisong    时间: 2004-10-16 15:43
标题: 请教TSL代码的问题.
刚学WinRunner有个关于 TSL的问题希望大虾赐教:
1. Set_window()和win_active()的功能是不是一样的?
2. 我在WinRunner的例子中看到了这样的一段script:
   for ( i in cust_arr ){....}
//cust_arr 是这样定义的: static cust_arr[]={"John","Steve","Miron","Patrick","Mary","Dan","Kim"};
这个例子可以通过运行, 但是我在帮助文档中没有看到for 循环有这样定义的, 不知道是为什么.

[ Last edited by rantisong on 2004-10-16 at 15:44 ]
作者: rantisong    时间: 2004-10-17 09:55
120
作者: bunny    时间: 2004-10-18 09:21
关注中
作者: QA_BAY    时间: 2004-10-19 13:06
static cust_arr[]={"John","Steve","Miron","Patrick","Mary","Dan","Kim"};
for ( i in cust_arr ){....}
这样没有错阿,就像这个例子一样
i=1
for ( i<21; i++)
{
        type (i);}
cust_arr[]这个是集合类型,所以它是要那样定义的!其它的就不太清楚了!
作者: rantisong    时间: 2004-10-19 14:14
Originally posted by QA_BAY at 2004-10-19 01:06 PM:
static cust_arr[]={"John","Steve","Miron","Patrick","Mary","Dan","Kim"};
for ( i in cust_arr ){....}
这样没有错阿,就像这个例 ...


我知道没有错啊,因为可以通过运行。 但是在定义For 循环的时候没有这样的定义啊. 你能详细的说明一下吗?
For 循环的其它条件呢?
是不是应该: for( ;i in cust_arr; ) {...}和上面的定义是相等的?

[ Last edited by rantisong on 2004-10-19 at 14:17 ]
作者: keen_20    时间: 2004-10-19 19:21
在我个人看来set_window()和win_activated()是一个作用
作者: QA_BAY    时间: 2004-10-21 10:37
对,是一样的,
作者: rantisong    时间: 2004-10-23 08:53
谢谢各位的指点。
作者: 生如火花    时间: 2004-10-23 08:54
对数组最好用switch 和case




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2