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

Re: argc & argv

From: Carlos Vergara <chv60_at_hotmail.com>
Date: Tue, 2 Dec 2003 00:18:49 -0500 (Hora est. Or. (EE.UU. y Canadá))

Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Great !=0D
=0D
I have to study and use it.=0D
=0D
Thanks a lot!=0D
 =0D
-------Original Message-------=0D
 =0D
From: sftalk_at_forth.com=0D
Date: November 30, 2003 08:38:15 PM=0D
To: sftalk_at_forth.com=0D
Subject: [sftalk] Re: argc & argv=0D
 =0D
Carlos,=0D
 =0D
The following will create an executable utilizing a console box as=0D
I/O.=0D
 =0D
REQUIRES DOSBOX=0D
 =0D
: ALL-DONE ( -- ) \ Proper cleanup=0D
    'ONSYSEXIT CALLS \ Execute System Exit Chain=0D
    0 ExitProcess ;=0D
 =0D
: GO ( -- )=0D
    DOS-CONSOLE OPEN-PERSONALITY=0D
    ." The command line contains" CR=0D
    CMDLINE ARGC 0=0D
    ?DO CMDLINE I ARGV TYPE CR=0D
    LOOP=0D
    CR ." Press any key to exit" KEY DROP=0D
    ALL-DONE ;=0D
 =0D
' GO 'MAIN !=0D
 =0D
-1 THRESHOLD \ No Xref file=0D
 =0D
PROGRAM CMDLINE=0D
BYE=0D
 =0D
 =0D
Mike=0D
 =0D
 =0D
-----Original Message-----=0D
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On=0D
Behalf=0D
Of Carlos Vergara=0D
Sent: Saturday, November 29, 2003 11:49 PM=0D
To: sftalk_at_forth.com=0D
Subject: [sftalk] Re: argc & argv=0D
 =0D
 =0D
=3D0D=0D
(Sorry, resending in plain text)=3D0D=0D
=3D0D=0D
Hi,=3D0D=0D
  =3D0D=0D
Jeff, thank you for your code. It guided me to start.f where there are=0D
th=3D=0D
e=0D
words cmdline, argc, argv and others.=3D0D=0D
  =3D0D=0D
I found that on startup SwiftForth interprets the command line which=0D
wind=3D=0D
ows=0D
passes to it. It means to me that forth will take the first argument=0D
and =3D=0D
try=0D
to execute it. Then, I wrote a word go which should take the command=0D
line=0D
and show the arguments:=3D0D=0D
  =3D0D=0D
: go ( -- )=3D0D=0D
cmdline argc 0 ?do=3D0D=0D
cmdline i argv type cr=3D0D=0D
loop=3D0D=0D
\ bye=3D0D=0D
;=3D0D=0D
  =3D0D=0D
PROGRAM cmdline.exe=3D0D=0D
  =3D0D=0D
If it works it means that I can work with the command line, which is=0D
what=3D=0D
  I=0D
want. =3D0D=0D
  =3D0D=0D
To test it we can write something like=3D0D=0D
cmdline go one two three four=3D0D=0D
in a dos box, which would type the lines go, one, two, three and four.=0D
An=3D=0D
d=0D
it did, but in a SwiftForth window.=3D0D=0D
  =3D0D=0D
Now, I don't want it to open the Forth window but to emit directly in=0D
the=0D
dos window I called the program from. Is it possible? If I use the=0D
dosbox=0D
package it will open a different dos box than the one I used to call=0D
the=0D
program, but also the SwiftForth box. I don't want the new dos box=0D
neithe=3D=0D
r=0D
the SwiftForth box. How can I do it?=3D0D=0D
  =3D0D=0D
Regards,=3D0D=0D
  =3D0D=0D
Carlos Vergara=3D0D=0D
=3D20=0D
----------------------------------------------------------------------=0D
 =0D
 =0D
 =0D
----------------------------------------------------------------------=0D
sftalk_at_forth.com The SwiftForth programming discussion email list=0D
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com=0D
For list command help, send subject "help" to sftalk-request_at_forth.com=0D
Message archives are located at http://www.forth.com/archive/sftalk=0D
----------------------------------------------------------------------=0D
This list is a forum for SwiftForth users. For product support and bug=0D
reports, please send email to support_at_forth.com=0D
----------------------------------------------------------------------=0D
=20

-- Binary/unsupported file stripped by Ecartis --
-- Type: image/gif
-- File: IMSTP.gif

----------------------------------------------------------------------
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 Dec 01 2003 - 21:27:06 PST

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