Happy New Year.
A little question. How to build a console application?
If I use this statement
STARTER CHESS PROGRAM CHESS.EXE
I launch Swiftforth environment, then automagically
it executes my word CHESS.
If I use this statement
' CHESS 'MAIN ! PROGRAM CHESS.EXE
my application has to build own window environment.
But I'd like to build a simple DOS-like program:
I launch the program from the prompt of the shell,
the program starts and displays a prompt, then...
Thanks in advance,
Alberto Santini
----- Original Message -----
From: "Rick VanNorman" <rvn_at_forth.com>
To: <sftalk_at_forth.com>
Sent: Sunday, June 25, 2000 1:23 AM
Subject: Re: [sftalk] turnkey apps problem
> The proper use of both STARTER and 'MAIN must be unclear.
>
> STARTER is how one defines an app that is to run in the
> SwiftForth command-window environment. This would be a
> typical Forth application that does not have any particular
> Windows interaction. THe word referenced by STARTER should
> *never* terminate at a semi-colon, but should either enter
> an endless loop processing user commands, or should end
> with the forth word BYE to terminate it. So, Marc's definition
> of TEST is almost correct, but not quite. Any one of these
> definitions is correct:
>
> \ very quick, won't see it
> : TEST1 ." hello" BYE ;
>
> \ say hello and wait for a keystroke
> : TEST2 ." hello" KEY DROP BYE ;
>
> \ say hello and enter the forth interpreter.
> \ this application, if shipped to a third-party
> \ would violate the Forth, Inc. license agreement.
> : TEST3 ." hello" QUIT ;
>
> STARTER TEST2 PROGRAM TEST2.EXE
>
>
> 'MAIN is how one defines an application that is intended
> to be a windows-native application. This application would
> not use the Forth command-window environment, but would
> create its own display and keystroke handlers from the
> windows messaging and api components. The simplest
> example of this is:
>
> : TEST4 0 z" Hello, world" Z" SwiftForth" MB_OK MessageBox DROP
> BYE ;
>
> ' TEST4 'MAIN !
>
> PROGRAM TEST4.EXE
>
> The word PROGRAM parses the next word, and appends .EXE if necessary.
>
> PROGRAM is also smart -- if it parses the name to be saved, and that
> name ends with .DLL, it assumes you want to make a DLL with
> exported functions and all that, but a topic for another day.
>
>
> Rick
>
>
>
> _______________________________________________
> Sftalk mailing list Sftalk_at_forth.com
> Visit Sftalk on the web at http://www.forthinc.com/mailman/listinfo/sftalk
Received on Sat Jan 06 2001 - 02:16:13 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.