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