home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!cbmvax!jesup
- From: jesup@cbmvax.commodore.com (Randell Jesup)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: THANK YOU!! (ReadArgs()).. but I'm handling something wrong
- Message-ID: <38083@cbmvax.commodore.com>
- Date: 21 Dec 92 03:54:37 GMT
- References: <BzHsLC.8rJ@usenet.ucs.indiana.edu>
- Reply-To: jesup@cbmvax.commodore.com (Randell Jesup)
- Organization: Commodore, West Chester, PA
- Lines: 31
-
- shulick@navajo.ucs.indiana.edu writes:
- >Well, the /M/A works and everything. Umm, something stopped working,
- >though. :) My template has gotten big, and I have these switches..
- >
- >".....,B=Blah/S,F=Foobar/S,....."
- >
- >Well, I used to check them like this:
- >
- > blah_mode = arr[1] == -1; /* assume 'B=Blah/S' was the second in */
- > /* the template */
-
- Two things: 1) check for 0/non-0, not exactly -1. All the autodoc
- promises is non-0. 2) It's best to define an enum or a bunch of defines, one
- for each parameter in the template. This means that if you change the
- template, all you have to do is change the enum/defines, instead of searching
- through your source code.
-
- >Well, it used to work, but now I have lots of things in my template, and
- >even though I DON'T specify a switch, it gets set -1 anyway! So what's
- >the REAL way to check if a switch is specified? Please POST, do NOT
- >reply via e-mail.. I get way too many responses to read. :) Thanks.
-
- Make sure the array is set to all 0's before calling ReadArgs. Other
- than that, it must be some sort of bug in your program.
-
- --
- 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.
-