Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!imagen!atari!apratt
From: apratt@atari.UUCP (Allan Pratt)
Newsgroups: comp.sys.atari.st
Subject: Re: argc and argv with gem
Keywords: MWC, argc, argv, GEM, commands.
Message-ID: <1173@atari.UUCP>
Date: 21 Sep 88 22:10:43 GMT
References: <358@island.uu.net> <626@mace.cc.purdue.edu> <3441@boulder.Colorado.EDU> <806@philmds.UUCP>
Reply-To: apratt@atari.UUCP (Allan Pratt)
Organization: Atari (US) Corporation, Sunnyvale, California
Lines: 36

In article <806@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes:
> In article <3441@boulder.Colorado.EDU> cochrane@spot.Colorado.EDU 
> (COCHRANE JIM T) writes:
> >How does one go about writing a GEM program that will accept arguments to
> >main via argc and argv?  I'm using Mark Williams C and when I try to use
> >argc and argv with a GEM program the program bombs.
> 
> Although I don't use MWC myself, I will make a few remarks:
>     1) There is no means that I know of to supply parameters to a Gem
>     program if it is started from the Desktop.

This is what "Install application" does.  This is how to use it to
install (for example) GFABASIC.PRG to run *.GFA:

	Select (click on) GFABASIC.PRG.

	Choose the menu item "Install Application" from the Options menu.

	Fill in the three blanks in the "Document Type" field with GFA.

Now, whenever you double-click a file *.GFA, GFABASIC.PRG will be run
and its command-line argument will be the name of the file you clicked.

Of course, it's up to the program (in this case, GFABASIC.PRG) to deal
with a command-line argument.  GFABASIC happens to do nicely; other
programs might not.  Microsoft Write, for one, does not. 

There are other caveats.  The "current directory" will be the directory
the file is in, not the directory the program is in, so finding your
resource file might be tricky.  Put all your resource files on the root
of the boot device (Drive C: if you have a hard disk) and AES will
always find them. 

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt