use ecl command as proc parameter input

你。 提交于 2020-01-03 05:05:43

问题


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

I have an ecl command:

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

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]

or

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.

Thanks


回答1:


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.

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



来源:https://stackoverflow.com/questions/51271324/use-ecl-command-as-proc-parameter-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!