![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

The SwiftForth kernel (formerly kernel.exe, recently renamed to sfk.exe) is itself a Windows console app. You could make your
own set of minimal "electives" in a source file named 'hi.f', start sfk.exe from your local directory, type HI to include hi.f
and you'll have your console environment ready to go. See src/ide/win32/hi.f (and also src/ide/linux/hi.f if you have it) for
examples of elective load files. If you're doing the linux beta test, that one serves as a good example because the Linux CLI
environment is very much like the Windows console environment. If there is general interest in the ability to make Windows
Console application turnkey programs, we'll add support for it in a future release. The sfk.exe Windows console kernel should
support I/O redirection, etc. Let me know if that isn't all there.
--Leon
> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of Alexander Seregin
> Sent: Monday, April 07, 2008 1:14 AM
> To: sftalk_at_forth.com
> Subject: [sftalk] How to write Win32-console application right?
>
> Good day!
>
> Could anyone give me advice how to write Win32-console right?
> Consider the example below. Yes, it creates standalone console-window but it
> is not the thing I wait for.
> I don't want to run program in standalone window quite the contrary.
> Also I want to use stantard redirection in OS like > or >>.
>
> Alexander Seregin
>
>
> : ZFILENAME ( zaddr - ) ZCOUNT PAD ZPLACE ;
> : ZDIRNAME ( zaddr - ) ZFILENAME S" - <DIR>" PAD ZAPPEND ;
> : .NAME ( zaddr - ) CR PAD ZCOUNT TYPE ;
>
> : .DIR ( zaddr - ) \ Show directory content
> [OBJECTS DIRTOOL MAKES DirSpec OBJECTS]
>
> DirSpec FIRST BEGIN ( flag) WHILE
> DirSpec FileName
> DirSpec IS-DIR IF ZDIRNAME ELSE ZFILENAME THEN .NAME
> DirSpec NEXT
> REPEAT DirSpec CLOSE ;
>
> : DIR ( "dirname")
> 0 WORD COUNT PAD ZPLACE S" \*" PAD ZAPPEND PAD .DIR ;
>
> : RUN
> CMDLINE ARGC 0= IF
> ." Usage SHOWDIR <dirname>"
> ELSE
> S" DIR " PAD ZPLACE CMDLINE 0 ARGV PAD ZAPPEND
> PAD ZCOUNT EVALUATE
> THEN KEY DROP 0 ExitProcess ;
>
> REQUIRES DOSBOX
>
> : GO /DOS-CONSOLE ['] RUN DOS-CONSOLE P-EXECUTE ;
>
> [DEFINED] PROGRAM [IF]
> -1 THRESHOLD ' GO 'MAIN ! PROGRAM SHOWDIR.EXE
> [THEN]
>
>
>
> ----------------------------------------------------------------------
> 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 Mon Apr 07 2008 - 07:46:49 PDT
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:44 PST