programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: A run once and exit EXE

From: Mike Ghan <mikeghan_at_logix-controls.com>
Date: Fri, 19 Dec 2003 07:16:52 -0800

I use the following to cleanly exit an application:

: ALL-DONE ( -- )
   'ONSYSEXIT CALLS ( Execute System Exit Chain )
   0 ExitProcess ( Terminate App ) ;

Any additional cleanup code you need is simply added to the chain with

:ONSYSEXIT ( cleanup code ) ;

Hope this helps,
Mike

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
Behalf
Of Richard Owlett
Sent: Friday, December 19, 2003 7:11 AM
To: sftalk_at_forth.com
Subject: [sftalk] A run once and exit EXE

Using "Play an MP3 file in six line of code" from the FAQ as an
example I wrote

library winmm.dll
4 import: mciSendString
create returnstring 256 allot
0 value returnvalue
: mcicommand returnstring 255 returnvalue mciSendString ;
: doesit z" play c:\atest\ding.wav" mcicommand drop ;
starter doesit
program c:\atest\playaudio.exe

It does what I want but doesn't exit cleanly.
I know I have to do some housekeeping, but can't remember what or
where to find.

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Dec 19 2003 - 07:17:50 PST

This archive was generated by hypermail 2.2.0 : Wed Nov 19 2008 - 03:04:21 PST