Forum Discussion

steve_hall's avatar
steve_hall
Contributor
13 years ago

WaitChild Not working?

Folks,



The following line of code is producing a JScript "object expected" error:



  if (Sys.Process("GEMS2").WaitChild(Form("GEMS2"),60000).Exists)





My understanding was that, having just started the GEMS2 process, the above should cause the script to wait up to 60 seconds for the top level child form (also GEMS2) to appear. But instead, I get the above mentioned error after just 5 or so seconds.



A bit of reading on the forums suggests WaitChild is broken in TC 9  (we're running 9.20). Can anyone comment / advise?



Thanks!





1 Reply

  • SOLVED!



    Such a subtle difference, but a big effect!



    WRONG: if (Sys.Process("GEMS2").WaitChild(Form("GEMS2"),60000).Exists)

    RIGHT: 
    if (Sys.Process("GEMS2").WaitChild("Form(\"GEMS2\")",60000).Exists)



    :) Hopefully this will help someone else in future!