home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!taloa.unice.fr!beust
- From: beust@aurora.unice.fr (Cedric Beust)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: More on ReadArgs() -- figured out some..
- Date: 18 Dec 1992 14:58:40 +0100
- Organization: University of Nice Sophia-Antipolis, France
- Lines: 40
- Distribution: world
- Message-ID: <1gslegINN908@aurora.unice.fr>
- References: <BzFLy3.r9@usenet.ucs.indiana.edu>
- NNTP-Posting-Host: aurora.unice.fr
-
-
- In article <BzFLy3.r9@usenet.ucs.indiana.edu>, shulick@navajo.ucs.indiana.edu
- (Sam Hulick) writes:
-
- Sorry, this is not exactly the answer you're expecting (I don't
- have my autodoc handy, I prefer not to say wrong things), but
- you might want to consider a certain style guide. Rather than
- using an array of LONG like :
-
- > LONG arr[500]; /* plenty of space */
-
- define a structure with meaningful fields, thus the parsing
- will be more readable. For example :
-
- struct {
- LONG ignore;
- char *learn;
- char *file;
- } cl;
-
- rd = ReadArgs("I=Ignore/S,L=Learn/S,Filelist/F/A", & cl, NULL);
-
- if (cl.ignore) {}
- else if (cl.learn) {}
- else if (cl.file) {}
-
- Just an idea I'm using (all the fields must have a size of
- sizeof(LONG)).
-
- Now, closer to your problem, there is a special flag that tells
- ReadArgs() to include all the rest of the command line (was it
- /S?) so you would most likely get a char * pointing to the list
- of files separated with spaces (just a guess, I never used this
- flag). You might want to take a look at Delete's template which is
- probably using this flag.
-
- --
- Cedric BEUST, beust@sa.inria.fr, Bull Research Koala proj, KoalaBus & xforum
- Pho:(33) 93.65.78.07(.66 Fax), INRIA, B.P.93 - 06902 Sophia Antipolis, FRANCE.
-
-