AskLine()

Started by mueer01, February 06, 2024, 11:03:50 PM

Previous topic - Next topic

mueer01

Hello,

The "Cancel" button from the function AskLine() quits the program.
Is it possible to get a @FALSE, @CANCEL or '' returned, instead?

Regards,
Erhard

td

You don't need a different function return value, but you do need to place a cancel label in your script. You can learn more about cancel handling by reading the following WIL Help page:

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/HTMLWIL_RFC001.htm
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mueer01

YEPP! That's it. Many thanks.

snowsnowsnow

Or you can use this function, which I wrote years ago and find very useful:


#DefineSubroutine udsTry(expr,errstr,cancelstr)
IntControl(73,1,1,0,0)
Return %expr%
:wberrorhandler
Return errstr
:cancel
Return cancelstr
#EndSubroutine