使用ecl命令作为proc参数输入 [英] use ecl command as proc parameter input

查看:56
本文介绍了使用ecl命令作为proc参数输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临着将ecl命令作为过程输入传递的问题.

I am facing an issue about passing ecl command as procedure input.

我有一个ecl命令:

get-editor [format "Configuration Editor - %s" $projNmae] | click

我想将此ecl命令作为过程中的参数输入.我正在做的是:

I want to take this ecl command as parameter input in a procedure. What i am doing is:

proc "wait-until-element-is-loaded" [val editor] {

loop [val count 0] {
    try {

        $editor | click

    } -catch {
        if [eq $count 4] {
            // 30 seconds
            throw-error [concat "element can not be loaded within the wait time. " $editor]
        }
        wait 100
        recur [$count | plus 1]
    }
 }
}

然后调用该过程,例如:

Then calling the procedure like:

wait-until-element-is-loaded |  get-editor [format "Configuration Editor - %s" $projName]

wait-until-element-is-loaded -editor  get-editor [format "Configuration Editor - %s" $projName]

但是它不起作用.我想执行此操作,因为我想在执行时在不同的时间传递不同的参数.

But its not working. I want to do this as i want to pass different parameter at different times while executing.

谢谢

推荐答案

我不认为您将Widget传递给用户编写的过程.

I don't think you pass a Widget to a user-written procedure.

我记得曾经尝试过一次,但是它对我也不起作用.

I remember trying it once, and it didn't work for me too.

将您的 wait-until-element-is-loaded 转换为接收字符串,并在其中调用 get-editor .

Convert your wait-until-element-is-loaded to receive a string and call get-editor inside it.

这篇关于使用ecl命令作为proc参数输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆