Question: How to stop algorithm executing?

Hello!

I im interesting  how to stop executing algorithm if user chose "cancel" in maplet filedialog?

restart;
maplet:=Maplet(FileDialog['FD1']('filefilter' = "*.txt,*.m",
'filterdescription' = "TXT-files and Maple m-files",
'directory'= "D:\\NIR\\Experimental result\\Data\\",
'onapprove' = Shutdown(['FD1']), 'oncancel' = Shutdown())):
Maplets[Display](maplet):
f1:=%[1];
#Point to stop executing
a := 1;
b := 2;

 

Please Wait...