Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!fub!opal!unido!rwthinf!cip-s06!wolfram From: wolfram@cip-s06.informatik.rwth-aachen.de (Wolfram Roesler) Newsgroups: comp.sys.atari.st Subject: Re: command line arguments Keywords: programming Message-ID: Date: 25 Jan 91 12:57:19 GMT References: <16531@cs.utexas.edu> Sender: news@rwthinf.UUCP Lines: 21 psurge@cs.utexas.edu (Troy Carpenter) writes: >How does one get a program in either of these languages to use arguments passed >from the command line. It's quite easy if you get the adress of your program's basepage. The adress of the command line as passed to the program is found in the basepage (sorry I don't know the precise offset). This is a pointer to a string of bytes terminated with a 0-byte. I dont know houw to get this using Pascal or M2. Getting hold of the program's calling name is not possible by legal means. You can of course check the basepage for the paren't basepage, check this one for the user stackpointer and use that in turn to get the parameters of the last command executed, which is Pexec with one of the parameters being the calling path of your program. My recommendation: turn to the true programming languages, use C and leave that problem to the runtime library. Pascal and M2 aren't made to fool arount in the system on a level as deep as that one needs to know that a byte is 8 bits long. :-) Greetings to US, give my regards to JR