Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!mtune!mtunb!dmt From: dmt@mtunb.ATT.COM (Dave Tutelman) Newsgroups: comp.lang.pascal,comp.sys.ibm.pc Subject: Re: Environment variables in Turbo Pascal Message-ID: <1022@mtunb.ATT.COM> Date: Tue, 4-Aug-87 08:10:15 EDT Article-I.D.: mtunb.1022 Posted: Tue Aug 4 08:10:15 1987 Date-Received: Thu, 6-Aug-87 01:20:08 EDT References: <151@ivory.SanDiego.NCR.COM> <1690@bellcore.bellcore.com> <1013@vi.ri.cmu.edu> Reply-To: dmt@mtunb.UUCP (Dave Tutelman) Distribution: world Organization: AT&T Information Systems - Lincroft, NJ Lines: 22 Xref: mnetor comp.lang.pascal:238 comp.sys.ibm.pc:6328 In article <1013@vi.ri.cmu.edu> jfb@vi.ri.cmu.edu.UUCP (John Brennan) writes: >Personally, I've never >had a real desire to know what argv[0] is. MS-DOS doesn't support links >(hard or symbolic), so each file has a unique name. But I can see where >you might want to be really friendly or something, and parse argv[0]. When I write a command-line program (non-intreractive, options given on the command line), I include lots of error messages in the code. As the programmer, I KNOW what the program is called, and SHOULD ALWAYS be called :-) But the USER can call the program anything, and invoke it by whatever filename he/she decides to store it as. I've chosen to deal with that dichotomy by parsing argv[0] into a string variable "progname", and using that in error messages wherever I report the program's name. ("The user is always right.") +---------------------------------------------------------------+ | Dave Tutelman | | Physical - AT&T - Lincroft, NJ | | Logical - ...ihnp4!mtuxo!mtunb!dmt | | Audible - (201) 576 2442 | +---------------------------------------------------------------+