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
Old 08-07-2019, 08:30 AM
Tonatiuh Tonatiuh is offline
Registered User
Join Date: Jul 2006
Posts: 69
MessageBox executed first than the previous WaitForString

This is my python script:

# $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

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
	strPrompt = objTab.Screen.ReadString("\n")
	#crt.Dialog.MessageBox("." + strPrompt + ".")
	strSrvctlSS = "srvctl status service -d myDB"
	objTab.Screen.Send (strSrvctlSS + "\r")
	bAnswer = crt.Dialog.MessageBox("Do you want to continue","", BUTTON_YESNO)
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?

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 05:49 AM.