简体   繁体   English

TTL:等待动态生成的字符串

[英]TTL: wait for dynamically generated string

I'm scripting an automation in TTL.我正在 TTL 中编写自动化脚本。

I have a parameter that is determined by the object I'm connecting to, so I parse it into a variable named pos .我有一个由我连接的对象决定的参数,所以我将它解析为一个名为pos的变量。 This part of the code is more than fine.这部分代码非常好。

Now, I'd like to wait for a textual string like现在,我想等待像这样的文本字符串

wait 'A 'pos' B'

Note that in the string I'm waiting for, the variable pos is part of the string.请注意,在我正在等待的字符串中,变量pos是字符串的一部分。 This syntax isn't working because, according to docs this is waiting on either A or pos or B .此语法不起作用,因为根据文档,它正在等待AposB

eg if pos=3 i'd like to wait 'A 3 B' as a whole, not as alternative.例如,如果pos=3我想wait 'A 3 B'作为一个整体,而不是作为替代。 I can't find in the docs the correct syntax to achieve this.我在文档中找不到正确的语法来实现这一点。

Don't put multiple strings, create a service variable and populate it,不要放多个字符串,创建一个服务变量并填充它,

msg = ''
strconcat msg 'A '
strconcat msg pos
strconcat msg ' B'
wait msg

seestrconcatstrconcat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM