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

Re: How to write Win32-console application right?

From: Alexander Seregin <a.seregin_at_foratec-com.ru>
Date: Tue, 8 Apr 2008 23:54:28 +0600

;-) I have just made what I want
Program was built using SFK.EXE but I had to exclude about 50% of includings
in Hi.F
to achieve desired results. I try to replace /CMDLINE without >BODY and it
was unsuccessful.
For now I can use redirection with my application and it runs in the same
Win32 consolewindow.

: ZFILENAME ( zaddr - ) ZCOUNT PAD ZPLACE ;
: ZDIRNAME ( zaddr - ) ZFILENAME S" - <DIR>" PAD ZAPPEND ;
: Z+\ ( - ) S" \*" PAD ZAPPEND ;
: .NAME ( - ) 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 Z+\ PAD .DIR ;

: RUN ( - )
   CMDLINE 2DUP ARGC 0= IF
      2DROP ." Usage SHOWDIR <dirname>"
   ELSE
      0 ARGV PAD ZPLACE Z+\ PAD .DIR
   THEN BYE ;

[DEFINED] PROGRAM [IF]
   ' RUN ' /CMDLINE >BODY ! PROGRAM SHOWDIR.EXE
[THEN]

> -----Original Message-----
> From: sftalk-bounce_at_forth.com
> [mailto:sftalk-bounce_at_forth.com] On Behalf Of Leon Wagner
> Sent: Monday, April 07, 2008 8:46 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: How to write Win32-console application right?
>
> 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
>
>
>
> ----------------------------------------------------------------------
> 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 Tue Apr 08 2008 - 10:50:06 PDT

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:44 PST