Lucia Cambise wrote:
to "force" the application exiting without error codes and without closing all windows opened
The only way I can think of is leaving the application running in the background. You can try the code in the attachment.

HTH,
Andreas

functor
import
   Application(exit)
   OS(getCWD)
   Property(get)
   Remote(manager)
   System(showInfo showError printError)
define
   CWD = {OS.getCWD}
   Stat
   functor
      RemoteApp
   import
      Application(exit) Error OS(chDir) Browser(browse)
   define
      {OS.chDir CWD}
      try
         {Browser.browse 'hello world'}
         thread
            for I in 5..0;~1 do {Delay 1000} {Browser.browse I} end
            {Application.exit}
         end
         Stat = unit
      catch E then
         Stat = {Error.messageToVirtualString {Error.exceptionToMessage E}}
      end
   end   
   RemoteMan = {New Remote.manager init(detach:true fork:sh)}
in
   {System.showInfo "Starting detached application..."}
   {RemoteMan apply(url:{Property.get 'application.url'} RemoteApp)}
   case Stat of unit then
      {System.showInfo "Starting detached application... done."}
   else
      {System.showError "*** ERROR [remote application]:"}
      {System.printError Stat}
      {System.printError "Closing remote manager..."}
      {RemoteMan close}
      {System.showError " done."}
   end
   {Application.exit 0}
end
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to