Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-08-2021, 07:58 AM
WesR WesR is offline
Registered User
 
Join Date: Mar 2005
Location: USA
Posts: 137
Exit Script without error popup

Hi,

My ultimate goal is to monitor the SSH session for a defined string and then create a dialog and send text when that string is found.

This I can do, but it gives an error whenever the SSH connection is lost. I want to suppress popup error and just exit the script.

I am starting the scrip using the Logon script option under Connection->Logon Actions.

The relevant part of the script looks like this:

Code:
crt.Screen.Synchronous = True
Sub Main
	'handle the login details here

	crt.Screen.Synchronous = False
	Do while 1
		If crt.Screen.WaitForString ("Explict Text") = True Then
			Result = crt.Dialog.Prompt("Enter a value", "Enter Value")
			If Result = "" Then exit sub
			'send the results here
		End If
	Loop
End Sub
I've tried playing On Error, but can't seem to get it to work for me.

Are you aware of another way to implement this functionality or to suppress the Connection Lost Error?

Currently running 8.2.0.

Thanks,

Wes
Reply With Quote
 


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:42 PM.