Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2011, 08:41 AM
dumbmick dumbmick is offline
Registered User
 
Join Date: Apr 2010
Posts: 4
looping on mapped keys

When I connect to equipment, I often have to run the same commands. I created keymappings for those commands, but I'd like to be able to add some frequency to have them repeat every 60 seconds or so. Is that do-able?
Thanks,
Tom
Reply With Quote
  #2  
Old 04-25-2011, 09:21 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Tom,

It would be possible to map a key to run a script which issues the command every 60 seconds.

Here is an example script:
Code:
crt.Screen.Synchronous = True
Do
    crt.Screen.Send "command" & vbcr
    crt.Screen.WaitForString vbcr
    crt.Sleep 60000
Loop
You could also use a variable that you increment and only loop while the condition is true.

For example:
Code:
nCount = 0
crt.Screen.Synchronous = True
Do While nCount < 3
    crt.Screen.Send "command" & vbcr
    crt.Screen.WaitForString vbcr
    nCount = nCount + 1
    crt.Sleep 60000
Loop
Does this help to accomplish your goal?
__________________
--Todd

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

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 11:16 AM.