VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   message box with timer (https://forums.vandyke.com/showthread.php?t=13547)

sg2000 05-16-2019 03:39 AM

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

bgagnon 05-16-2019 10:03 AM

Hi sg2000

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

to:
crt.Dialog.MessageBox "Wait for " & CStr(i) & " seconds"

sg2000 05-22-2019 03:22 AM

Quote:

Originally Posted by bgagnon (Post 51520)
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

bgagnon 05-22-2019 08:31 AM

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.

sg2000 05-22-2019 08:38 AM

Quote:

Originally Posted by bgagnon (Post 51564)
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

bgagnon 05-23-2019 08:45 AM

1 Attachment(s)
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.


All times are GMT -6. The time now is 06:39 PM.