Re: Command line redirected i/o

From: Alberto Santini <Alberto_Santini_at_bpm.it>
Date: Mon, 10 Apr 2000 08:08:45 +0100

Thanks Rick.

How to get the command line arguments?

SF param1 param2 ...

Thanks in advance,
Alberto.

SF Talk <sftalk_at_forth.com> on 04/09/2000 08:33:01 PM

Please respond to SF Talk <sftalk_at_forth.com>

To: SF Talk <sftalk_at_forth.com>
cc: (bcc: Alberto Santini/BPM)
Subject: Command line redirected i/o

Date: Sun, 09 Apr 2000 11:07:26 -0700
From: "Rick VanNorman" <rvn_at_forth.com>
Subject: Command line redirected i/o

Is this useful to anyone?

Rick

{ ====================================================================
(C) Copyright 2000 FORTH, Inc. Rick VanNorman rvn_at_forth.com

Using standard io streams
==================================================================== }

{ --------------------------------------------------------------------
Assuming that sf was started with a command line resembling

   SF < anypath\infile.ext > anypath\outfile.exe

the following will create file handles for io to the standard io
files. Please remember to close the files before exiting.

Files opened for stdio may use all of the ANS file words. A handle
value of 0 indicates that no io redirection was indicated when
then program was started.
-------------------------------------------------------------------- }

1 IMPORT: GetStdHandle

0 VALUE STDIN
0 VALUE STDOUT

: OPEN-STDIN ( -- fid ior )
   STD_INPUT_HANDLE GetStdHandle DUP INVALID_HANDLE_VALUE = ;

: OPEN-STDOUT ( -- fid ior )
   STD_OUTPUT_HANDLE GetStdHandle DUP INVALID_HANDLE_VALUE = ;

.
Received on Sun Apr 09 2000 - 11:07:26 PDT


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.