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

Re: BYE

From: Rick VanNorman <rick_at_neverslow.com>
Date: Thu, 05 Jul 2001 19:41:06 -0700

John,

>There appears to be a problem with BYE not completely unloading the
>program that calls it.
>
>I've been using this little stub program I wrote which calls my editor
>from the SwiftForth
>console to open a file, It gets called frequently and I thought it was
>working great,. Then the
>other day I had to use Ctrl-Alt-Del to shut something down and in the task
>list I see about five
>copies of it "running". So I searched the archives regarding bye and ran
>the example.
>
>: test 0 z" hello world" z" test" MB_OK MessageBox drop bye ;
>
>' test 'main !
>program test.exe

BYE is a deferred word. Its definition is given by

: (BYE)
   HWND WM_CLOSE 0 0 SendMessage DROP BEGIN STOP AGAIN ;

' (BYE) IS BYE

This is an active console word, not the end of a stand-alone non-console
application. Note that it uses HWND, which is never set by the system
if you replace the 'MAIN vector. (You could manually set it, but for this
application there is nothing to set it to.)

The definition of BYE can't change and be a valid console interpreter
environment; please use the phrase "0 ExitProcess" to terminate any
non-console application started by changing the 'MAIN vector.

Thanks,
Rick

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Thu Jul 05 2001 - 19:43:39 PDT

This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:18 PST