查看完整版本: 帮忙看看这段代码,nargs?

kelly-可儿 2007-7-10 14:16

帮忙看看这段代码,nargs?

在学tsl语言,nargs();看了WR帮助,还是不懂,请大家帮忙解释一下沙,贴一段程序,那个nargs()>3啥意思?
还有return(-10002);为什么是-10002,不懂。
public function  SelectRow(in table,in col,in cellvalue,out rownum)
        {
                auto rc,i,cv,arr[];
                if(nargs()<3)
                        return E_ILLEGAL_NUM_OF_PARAMS;
                       
                tbl_get_rows_count(table,rc);        
                for(i=1;i<=rc;i++)                                       
                {
                        tbl_get_cell_data(table,"#"&i,col,cv);
                        if(cv==cellvalue)                             
                        {
                                tbl_set_selected_row(table,"#" &i);
                                rownum=i;
                                return(E_OK);
                        }       
                }
                return(-10002);
        }

shiwomyw 2007-7-10 15:39

nargs()<3;我认为这个函数主要是判断本函数中传的参数个数.

kelly-可儿 2007-7-10 17:00

别的同志也给点解释吆

kelly-可儿 2007-7-11 09:15

咋没人回呀?sdlkfj9

kolecat 2007-7-11 14:15

returns the number of arguments passed.
nargs ( ); 函数作用



winrunner返回值定义
E_NOT_FOUND        -10002        Window or object not found.

kelly-可儿 2007-7-11 15:58

首先谢谢大家的解答,nargs();的解释是WR帮助里的[color=Red],"returns the number of arguments passed."[/color],不是特别懂。是返回参数的个数吗?

dionysus 2007-7-11 22:55

[quote]原帖由 [i]kelly-可儿[/i] 于 2007-7-11 15:58 发表 [url=http://bbs.51testing.com/redirect.php?goto=findpost&pid=604613&ptid=82309][img]http://bbs.51testing.com/images/common/back.gif[/img][/url]
首先谢谢大家的解答,nargs();的解释是WR帮助里的,"returns the number of arguments passed.",不是特别懂。是返回参数的个数吗? [/quote]
是这个意思,检查传递的参数个数
页: [1]
查看完整版本: 帮忙看看这段代码,nargs?