Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #16  
Old 08-06-2019, 08:42 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,961
Hi CAPflyboy,

Originally with your script (edited a bit to fit my environment), I got the same results as you reported. But after a few tweaks, it runs the same with or without the MsgBox(). The presence of the MsgBox() should not change the results, but what it does is if your script is out of sync, it allows it to get back in sync, so I think that's what you were seeing.

The major changes I made were:
  • Reduced the number of times you set Synchronous to True/False. You should set it True after the connection line in ConnectSession() function and then to False in the ExitSession() function.

  • In the ExecuteCommands() function, there are numerous occasions where you don't follow the best practice described in the scripting manual (section 4.2) that there should be a WaitForString() following each Send() command. And for sure you want to uncomment this line:
    Code:
        crt.Screen.WaitForString "EDT"
  • Lastly, changed ExitSession():
    Code:
        crtSc.Send "logo"
        crtSc.WaitForString "logo"
        crtSc.Send vbCr
    
        crtSc.synchronous = False
    
        Do
            crt.Sleep 25
        Loop While crt.Session.Connected
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #17  
Old 08-06-2019, 09:56 AM
CAPflyboy CAPflyboy is offline
Registered User
 
Join Date: Mar 2016
Posts: 2
Thanks Brenda!

I agree with your best practice suggestion and will implement it straight away!

A lot of the "crt.Screen.WaitForString" code under the ExecuteCommands () section was my attempt to slow or see where it was out of sync. Now that it is working correctly, I'll remove most of the extra WaitForString statements.

Thanks again for the assistance. VERY much appreciated!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:45 AM.