home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17593 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.7 KB

  1. Path: sparky!uunet!cbmvax!jesup
  2. From: jesup@cbmvax.commodore.com (Randell Jesup)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: More on ReadArgs() -- figured out some..
  5. Message-ID: <38056@cbmvax.commodore.com>
  6. Date: 19 Dec 92 02:43:47 GMT
  7. References: <BzFLy3.r9@usenet.ucs.indiana.edu>
  8. Reply-To: jesup@cbmvax.commodore.com (Randell Jesup)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 36
  11.  
  12. shulick@navajo.ucs.indiana.edu writes:
  13. >Ok, I've figured out a little bit.  I have this:
  14. >
  15. >  LONG arr[500];  /* plenty of space */
  16.  
  17.     You should have one entry per "argument" in the template.
  18.  
  19. >  memset(arr, '\0', sizeof(arr));
  20. >  rd = ReadArgs("I=Ignore/S,L=Learn/S,Filelist/F/A", arr, NULL);
  21. >
  22. >  So if arr[0] == -1, that means the user said 'i' or 'ignore'
  23. >And if arr[1] == -1, then Learn is chosen.  And for arr[2], I get the
  24. >files picked.  Now this is a MAJOR problem if the user selects 200
  25. >files.  How in the world do I parse a string like: "file1 file2 ...
  26. >file200".  What I originally wanted was:
  27. >
  28. >  rd = ReadArgs("Filelist/M/A,I=Ignore/S,L=Learn/S", arr, NULL);
  29. >except that when I parsed out the filelist, it wasn't a string.. just
  30. >garbage.  Like I said, I wish ReadArgs() was documented in
  31.  
  32.     This is correct.  However, if you read the autodoc, it passes you back
  33. a pointer to an array of pointers to the strings.  The array ends with a NULL
  34. pointer.
  35.  
  36.     [filelist]  ->    [string ptr] -> "skdfjskjdf"
  37.             [string ptr] -> "string 2"
  38.             [ NULL     ]
  39.     [ignore]
  40.     [Learn]
  41.  
  42. -- 
  43. To be or not to be = 0xff
  44. -
  45. Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
  46. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
  47. Disclaimer: Nothing I say is anything other than my personal opinion.
  48.