Title: Message
Peter,
 
First the problem with you being unable to kill your script, not sure if you tried this or not but pressing the pause (double bars - vcr style button) on the workstation first should get you into your script, then press the stop button inside vba.
 
Next the obvious who wants to hear it now but it must be said so others can learn from your mistake. Never run your script without saving it first - anything can happen.
 
Lastly - the logout, you could write a pauseloop routine to discover where Meditech is and respond to these screens, as an added protection you could incorporste a counter that once at a certain point you assume Meditech is gone and kill your script anyway.
 
Example:
 
c = 0
Do
    Stable 0.4
    c=c+1
    Pauseloop "One of the screens", "{esc}"
    Pauseloop "another one of the screens", "{esc}"
    If at("The Desktop Menu") Then
        Key "{esc}"
        Key "{esc}"
    Endif
    If c > 50 Then 'assume it escaped out and I didn't catch it somehow (this part not usually necessary)
        Halt 'or go do more cleanup
    Endif
Loop Until At("Next to lastscreen")
Key "{esc}"  'final escape because you logged to the next to last screen


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Turner, Peter
Sent: Friday, July 16, 2004 11:58 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Client Server shutdown

To Corinna, I am trying to shutdown the Meditech session and return control to the BWS console.  The code I show does shutdown Meditech, but all too often - uncannily usually after I have made changes that I haven't got around to saving, it leaves BWS "keying ESC" and nothing I do to VBA or BWS can regain control. 
 
Timeout is set so I would expect it to give up after 30 seconds - it doesn't seem to - Yesterday I let it sit over an hour hoping I could eventually save a particularly clever routine I had just written - but alas it never let go.   I had to kill the BWS process. 
 
I am attempting to have a routine that backs me out from any level without needing to know where I am.  Is there a code example somewhere that shows Rich's method?
 
Meditech's version is handy - would be a nice addition - because it just whacks the session - don't have to try to figure out you are trying to type string into a date field, so Meditech is stuck on a warning box.
 
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Corinna
Sent: Friday, July 16, 2004 9:00 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Client Server shutdown

Are you trying to shutdown Boston Workstation or are you trying to detect if Meditech is shutdown?
 
Thanks,
Corinna Robertson
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent: Friday, July 16, 2004 9:09 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Client Server shutdown

I’d suggest adding explicit Pause or PauseLoop commands to exit the session, kind of a reverse of a login script.  I attempt the kind of “shortcut” your script shows whenever I can, but I almost always end up regretting it.

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Turner, Peter
Sent: Friday, July 16, 2004 8:57 AM
To: [EMAIL PROTECTED]
Subject: [Talk] Client Server shutdown

 

Meditech's scripting dll has a shutdown function:

 

Function MCSShutdown Lib "MCScript.dll" 

 

Is there something analogous in BWS?

 

I have been trying this:

 

    Do  
      If InStr(UCase(wso.View), UCase("Closed")) > 0 Then
        Exit Do
      End If
      wso.Key "{esc}"
      wso.Wait 2
      DoEvents
    Loop
 

But it seems to sometimes leave me in status of Keying ESC, yet the MT session is closed, so it ends up waiting for Godot.  BSW console does not seem to respond to stops, reset script doesn't get it either.  When it does this - not all the time either, by the way, I have to end task.   

 

Is there a better, more graceful way to bail out?

Reply via email to