Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!pt!vi.ri.cmu.edu!jfb From: jfb@vi.ri.cmu.edu.UUCP Newsgroups: comp.lang.pascal,comp.sys.ibm.pc Subject: Re: Environment variables in Turbo Pascal Message-ID: <1013@vi.ri.cmu.edu> Date: Fri, 31-Jul-87 18:00:40 EDT Article-I.D.: vi.1013 Posted: Fri Jul 31 18:00:40 1987 Date-Received: Sun, 2-Aug-87 10:24:42 EDT References: <151@ivory.SanDiego.NCR.COM> <1690@bellcore.bellcore.com> Distribution: world Organization: Carnegie-Mellon University, CS/RI Lines: 27 Xref: utgpu comp.lang.pascal:204 comp.sys.ibm.pc:5469 Summary: undocumented feature is documented In article <1690@bellcore.bellcore.com>, tr@wind.bellcore.com (tom reingold) writes: > In article <151@ivory.SanDiego.NCR.COM> mike@ivory.UUCP (Michael Lodman) writes: > $ Could someone please email and tell me how to read the DOS environment > $ variables with Turbo Pascal? > > Mike Morearty posted this to the net a while back. I made very > minor changes. Where I did so, I put my first name (Tom) on the > line. The program should be pretty clear. > > I just discovered an undocumented feature of the more recent > versions of DOS: it is at last possible to obtain argv[0]. > The method described is documented, quite clearly, in the PC-DOS 3.0 (3.1?) manual. Maybe your documentation is missing it... I can't even guess. Supposedly, this was considered a problem in DOS 2.0. 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]. Anyway, keep on hacking... John Brennen jfb@vi.ri.cmu.edu Visual Inspection Lab Carnegie Mellon Univ.