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
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.