View Single Post
  #1  
Old 02-11-2019, 12:11 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Track and Close multiple tabs

I have a script that will open and work with multiple tabs. I tried closing all of them if a close option is used but it crashes secureCRT 75% of the time.

Is there a better way to check if a tab has been used and close it and not touch any other tabs a user may have open?

This is the part of my script I think is crashing SecureCRT.
Code:
Select Case Action
					Case "CLOSE"
						On Error Resume Next
						If bsmTab.Session.Connected = -1 Then bsmTab.Close
						If csrTab.Session.Connected = -1 Then csrTab.Close
						If lteTab.Session.Connected = -1 Then lteTab.Close
						If cdmaTab.Session.Connected = -1 Then cdmaTab.Close
						If mwTab.Session.Connected = -1 Then mwTab.Close
						On Error GoTo 0
						Exit Sub
					Case "CANCEL"
						If bsmTab.Session.Connected = -1 Then bsmTab.Close
						Exit Do
I tried just closing them all with .Close but that crashed every time. So then I tried with the .Connected test but that didn't help much.

If I don't use the on error goto next I get an exception every time as only some of the tabs get set most of the time. It is rare that all tabs will be open.

The error is
SecureCRT experienced a fatal error and must close.
Version 6.7.3 (build 292)
__________________
Version 6.7.3 (build 292)
Reply With Quote