viewpoint-particle

Author Topic: Break signal to cancel script  (Read 603 times)

fhammer

  • Newbie
  • *
  • Posts: 44
Break signal to cancel script
« on: March 09, 2017, 01:55:25 pm »
When one of my scripts gets into a undesired loop, I use a Break signal to cancel execution. However, the process for sending a Break signal differs from keyboard to keyboard. I would like to add an item to my PopMenu to do that, so that I don't have to remember the keyboard-specific procedures.

I vaguely-recall seeing a "Send a Break Signal" function in WIL, but now I can't find it.

Any advice?

Thanks.

td

  • Tech Support
  • *****
  • Posts: 2158
    • WinBatch
Re: Break signal to cancel script
« Reply #1 on: March 09, 2017, 02:28:02 pm »
Perhaps you are referring to sending a ctrl+break key sequence using either SendKey or SendKeysTo?  If so, more details about these functions can be found in the Consolidated WIL Help file.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2158
    • WinBatch
Re: Break signal to cancel script
« Reply #2 on: March 10, 2017, 06:40:17 am »
You may also want to consider the TerminateApp function.  It has a flag parameter, value 0, specifically designed to aid terminating a WinBatch script.  Again check out the Consolidated WIL help file for details.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


fhammer

  • Newbie
  • *
  • Posts: 44
Re: Break signal to cancel script
« Reply #3 on: March 23, 2017, 10:16:03 pm »
Thanks TD. SendKey("{CANCEL}") did the trick.

td

  • Tech Support
  • *****
  • Posts: 2158
    • WinBatch
Re: Break signal to cancel script
« Reply #4 on: March 24, 2017, 07:18:32 am »
"{CANCEL}" is just another way to send the Control+Break key combination.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates