Search code examples
teraterm

TTL: wait for dynamically generated string


I'm scripting an automation in TTL.

I have a parameter that is determined by the object I'm connecting to, so I parse it into a variable named 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. This syntax isn't working because, according to docs this is waiting on either A or pos or B.

e.g. if pos=3 i'd like to wait 'A 3 B' as a whole, not as alternative. I can't find in the docs the correct syntax to achieve this.


Solution

  • Don't put multiple strings, create a service variable and populate it,

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

    see strconcat