A program using STARTER is by definition loading the console
window environment. In this case, the cleanest and most proper
way to exit is to use the word BYE .
If you are writing a stand-alone program for Windows, which
contains its own message loop, you should be using the
ExitProcess technique. This type of application would be
built by setting 'MAIN before saving the application.
Bob's suggestion won't do as it might appear -- the playsound
api doesn't return until the sound is finished.
(preface all by "If I remember correctly...")
Rick
On Dec 19, 2003, at 8:11 AM, Bob Nash wrote:
> Well, for a real quick and dirty, just add something like "10000 Sleep
> =
> DROP 0 ExitProcess" to the end of the definition of doesit. Of
> course =
> it will cut the sound off if it lasts longer than 10 seconds. I
> suspect =
> there is a way of detecting the end of a "play" operation and =
> eliminating the window display during play, but I said it was quick
> and =
> dirty, didn't I?
>
> -----Original Message-----
> From: Richard Owlett [mailto:rcowlett_at_atlascomm.net]
> 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=20
> 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=20
> 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
----------------------------------------------------------------------
Received on Fri Dec 19 2003 - 08:21:38 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.