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

How to write Win32-console application right?

From: Alexander Seregin <a.seregin_at_foratec-com.ru>
Date: Mon, 7 Apr 2008 14:13:39 +0600

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
----------------------------------------------------------------------
Received on Mon Apr 07 2008 - 01:09:25 PDT

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