home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17595 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.7 KB  |  53 lines

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