User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with writing and running scripts
4 posts Page 1 of 1
I want to abort/break/cancel/exit a script execution by script code, i.e. after user input via getstring(), I want to abort further processing of the script, depending on input value. I can use if-else(){}, but I want to use abort script command.

I searched the help and the forum but could not find it.

Please guide.

Regards, Anand
Put your entire script code into a function. And main part of script exists of only calling this function. This makes it possible to use in the function return; whenever you want exit the script.
Best regards from Austria
Thanks a lot Mofi for the tip. I hope this will help many script programmers here who do not know about it, I am one.

I am using below code to cancel a script. Is there a way to use "YesNoMsgBox" thing for it?

Code: Select all
yesno = UltraEdit.getString("Confirm delete lines : (y/n) ",1);
if( yesno != "y")
{
   return false;
}

Regards, Anand
Anand wrote: Is there a way to use "YesNoMsgBox" thing for it?

There is only UltraEdit.getString() and UltraEdit.getValue() built-in available in UltraEdit.

And there is New Dialog: Options() for a script customizable dialog with a list box.

The macros and scripts features in UltraEdit are mainly for reformatting text data automated with no or an absolute minimum of user interaction. For that reason there are not many commands available which interact with a human user using the UltraEdit macro/script.
Best regards from Austria
4 posts Page 1 of 1
cron