Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!sun-barr!olivea!oliveb!amdahl!rtech!dosbears!mikel From: mikel@dosbears.UUCP (Mike Lipsie) Newsgroups: comp.windows.ms Subject: Re: PATH for Windows applications Message-ID: <465@dosbears> Date: 14 Jun 91 05:57:00 GMT References: <10816@plains.NoDak.edu> Reply-To: dosbears!mikel@pyramid.com (Mike Lipsie) Organization: DOS Bears Lines: 25 In article <10816@plains.NoDak.edu> coffman@plains.NoDak.edu (Clark Coffman) writes: > [store "home directory" for program in win.ini] > > You know, that would work, but I've always wondered why professional >programmers don't use argv[0] to find the path! I'm what my friends call >a sportsman programmer in C and I use argv[0] to find where my programs >have been started up (so they can find their configuration files). Why >don't others use this? It returns the full path, including the drive, >to where ever the user has stored your program. I guess I'm assuming that >Pascal and other languages have a similar feature? It is not a language (C, Pascal, ...) feature. It is a DOS feature. In versions of DOS before 3.0, argv[0] is the null string. If you are writing a piece of code that will run on the most machines possible ... Hey! I bet that there are still machines running DOS 1.x. (I think I still have a copy somewhere arounf here.) -- Mike Lipsie dosbears!mikel@pyramid.com mikel%dosbears.uucp@ingres.com