Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!rochester!udel!gatech!dcatla!ittfb From: ittfb@dcatla.UUCP (Thomas F. Blakely) Newsgroups: comp.sys.ibm.pc,comp.sys.att Subject: Re: Anyone know how to discover the DOS switch character? Message-ID: <2157@dcatla.UUCP> Date: Fri, 13-Nov-87 08:24:53 EST Article-I.D.: dcatla.2157 Posted: Fri Nov 13 08:24:53 1987 Date-Received: Sun, 15-Nov-87 09:53:30 EST References: <2678@ihlpf.ATT.COM> <2257@ihuxy.ATT.COM> Reply-To: ittfb@dcatla.UUCP (Thomas F. Blakely) Organization: DCA Inc., Alpharetta, GA Lines: 26 Keywords: DOS, IBMPC, PC6300, switch, assembler Xref: mnetor comp.sys.ibm.pc:10126 comp.sys.att:1749 In article <2257@ihuxy.ATT.COM> vg55611@ihuxy.ATT.COM (gopal) writes: >But, why read the switchar at all ? Just replace all occurrences of '/' >with '\' in the arg string (or the string of concern) and then the user of >your program can use either. This is what I do with programs I write. This is not a good idea. You are replacing _potential_ switch characters with the _path-separator_ character. Also, it limits you to those two characters. Someone may want to use something obscure (like '-' :-). Using something unique from the path character allows command line constructs like: command/sw1/sw2 arg1/asw1 arg2/asw2 This allows global options (sw1, sw2) and options specific to each argument (asw1, asw2). We have a lot of users here used to VMS, and this is real handy. If you just replace all '/' with '\', argv[0] looks like: /root/bin/command/sw1/sw2 This is a not very clean parse. Besides, DOS function 37H works, and it's actually easier to call it than to have to massage the command arguments. T. Blakely (404)442-4866 {gatech, sun!sunatl}!dcatla!ittfb