WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: fhammer on March 09, 2017, 01:55:25 PM

Title: Break signal to cancel script
Post by: fhammer 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.
Title: Re: Break signal to cancel script
Post by: td 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.
Title: Re: Break signal to cancel script
Post by: td 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.
Title: Re: Break signal to cancel script
Post by: fhammer on March 23, 2017, 10:16:03 PM
Thanks TD. SendKey("{CANCEL}") did the trick.
Title: Re: Break signal to cancel script
Post by: td on March 24, 2017, 07:18:32 AM
"{CANCEL}" is just another way to send the Control+Break key combination.