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 05-16-2019, 03:39 AM
sg2000 sg2000 is offline
Registered User
 
Join Date: May 2019
Posts: 6
message box with timer

Hello,

When calling this function we see on the screen "Wait for...)on the bottom left side.

Code:
Function timer(zeit)
	for i=zeit to 1 Step -1
		crt.Session.SetStatusText("Wait for " & CStr(i) & " seconds")
		crt.sleep 1000
		Next
End Function
I would like to display this countdown into a MsgBox.

How to do that ?

Thanks
Reply With Quote
  #2  
Old 05-16-2019, 10:03 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,015
Hi sg2000

Change:
crt.Session.SetStatusText("Wait for " & CStr(i) & " seconds")

to:
crt.Dialog.MessageBox "Wait for " & CStr(i) & " seconds"
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 05-22-2019, 03:22 AM
sg2000 sg2000 is offline
Registered User
 
Join Date: May 2019
Posts: 6
Quote:
Originally Posted by bgagnon View Post
crt.Dialog.MessageBox "Wait for " & CStr(i) & " seconds"
Thanks Brenda but it doesn't work correctly. You need to press ok to see the countdown!!!
I would like too see time remaining without to press any key!

Any idea ?

Thanks
Reply With Quote
  #4  
Old 05-22-2019, 08:31 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,015
Hi sg2000,

It is working correctly because that is the design of the MessageBox function (as well as VB's MsgBox, which is what you asked for). It apparently is just not suitable to your objective.

There's no option that I know of to suppress the buttons in the MessageBox/MsgBox functions. Status bar text is your best bet. (I wondered why you were changing it.) Or, you could probably integrate with IE and use it to display a custom dialog but I don't have any exact info on how to do that.

I have added this thread to a feature request in our product enhancement database for the ability to create custom dialog boxes or other GUI elements (forms scripting). Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #13547" in the subject line or use this form from the support page of our website.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 05-22-2019, 08:38 AM
sg2000 sg2000 is offline
Registered User
 
Join Date: May 2019
Posts: 6
Quote:
Originally Posted by bgagnon View Post
Hi sg2000,

It is working correctly because that is the design of the MessageBox function (as well as VB's MsgBox, which is what you asked for). It apparently is just not suitable to your objective.
Thanks I would like to it for sequential test.
SecureCrt must wait automatically for n seconds and after that script continue. I would like to see the countdown better that on the bottom left side.

Thanks
Reply With Quote
  #6  
Old 05-23-2019, 08:45 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,015
Hi sg2000,

In talking to my manager (also script guru), we thought maybe the attached example code could help in your objective.

You would have to be using v7.2 or later:

Changes in SecureCRT 7.2 (Beta 1) -- October 8, 2013
----------------------------------------------------

New features:

  • The script function Screen.Send() can be used to send text to the screen only by using a new optional parameter.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
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 01:24 PM.