How to exit a package in the middle, for example,
BeginPackage["myPackage"]
Begin["`Private"]
DoSomething
If[$FrontEnd===Null, Abort[]]
DoSomethingIfFrontEndDefined
End[]
EndPackage[]
Here Abort[] doesn't really quit the whole package. Is there any command which can do this?
I could use Goto but that sounds not good. Also I don't want to Quit[] because I want to use the definitions in the DoSomething part.
If[$FrontEnd=!=Null,DoSomethingIfFrontEndDefined]
? And you are missing some trailing backquotes in your context names... $\endgroup$