Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-07-2019, 08:30 AM
Tonatiuh Tonatiuh is offline
Registered User
 
Join Date: Jul 2006
Posts: 68
MessageBox executed first than the previous WaitForString

This is my python script:

Code:
# $language = "python"
# $interface = "1.0"

import SecureCRT
import os
import sys

strPath = os.path.dirname(__file__)
if strPath not in sys.path: sys.path.insert(0, strPath)


import modPlatform
import modParseOutput
import modStrBoolean
reload(modPlatform)
reload(modParseOutput)
reload(modStrBoolean)

def Main():

    # Get the absolute path of the running script
	strSlash = modPlatform.GetSlashChar()
	strPath = os.path.dirname(__file__) + strSlash
	
	objTab = crt.GetScriptTab()
	objTab.Screen.Synchronous = True
		
	# Get the current Prompt
    # Send twice the RETURN keystroke to be able to read the prompt in the the second execution
	objTab.Screen.Send("\r")
	objTab.Screen.WaitForString("\n")
	objTab.Screen.Send("\r")
	strPrompt = objTab.Screen.ReadString("\n")
	#crt.Dialog.MessageBox("." + strPrompt + ".")
	
	strSrvctlSS = "srvctl status service -d myDB"
	objTab.Screen.Send (strSrvctlSS + "\r")
	objTab.Screen.WaitForString("]$")
	bAnswer = crt.Dialog.MessageBox("Do you want to continue","", BUTTON_YESNO)
	
Main()
The line: bAnswer = crt.Dialog.MessageBox("Do you want to continue","", BUTTON_YESNO)
Executes before the line: objTab.Screen.Send (strSrvctlSS + "\r")

What did I do wrong?

Regards,
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:31 AM.