TIP: Click on subject to list as thread! ANSI
echo: tech
to: Roy J. Tellason
from: mark lewis
date: 2003-12-17 15:36:00
subject: another foul up

RJT> I'm not sure how the heck the program works,  as dos doesn't
 RJT> provide a running program with what under linux and elsewhere
 RJT> would be argc[0],  the name it was invoked under.

actually, it does...

===== pascal code =====
program parm_zero_test;

var
  progname : string;

begin
  progname := paramstr(0);
  writeln('my executable name is: ',progname);
end.
===== end code =====

the above will return the complete path including drive letter and the
executable name... there are other lowlevel methods available, too... i've
one for retrieving command line parameters that goes to the program's load
area and reads the stuff right out of memory... its not limited by borland
pascal's string limit that are in TP6 and TP/BP7...

its been a while, eh? >

back to what was really being discussed... those programs that alias names
to programs won't work as some might think... this is because the program
is still called by its original name and doesn't know anything about the
alias... both CED and the 4DOS alias stuff... IIRC, DOSKEY with MSDOS5 also
has alias functions... at least i'm thinking DOSKEY unless that's the one
that provides a command line buffer you can arrow thru...

)\/(ark

* Origin: (1:3634/12)
SEEN-BY: 633/267 270
@PATH: 3634/12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.