Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!hplabs!hpl-opus!hpnmdla!bingham From: bingham@hpnmdla.sr.hp.com (David Bingham) Newsgroups: comp.os.msdos.programmer Subject: Re: COMMAND LINE RECALLING Message-ID: <11270008@hpnmdla.sr.hp.com> Date: 4 Jun 91 20:15:23 GMT References: <91154.184957UD156844@NDSUVM1.BITNET> Organization: HP Network Measurements Div, Santa Rosa, CA Lines: 59 > I'm interested in writing a program to recall previous parameters > issued on the DOS command line. My question is where are these > commands placed by DOS. Are they placed in the PSP? Next what > type of interrupt is used to fetch the command? Will I interrupt this > command to relocate it in a table then continue to execute the command? > As you can probably tell I'm an inexperianced DOS programmer, but I > feel this program will help me to learn while not being immpossible > for my level of abilities. So I would appreciate any suggestions > and help! By the way I will write this in either C or Assembly. > > Thanks in advance! > > Roberto Alvarez > UNIVERSITY OF NORTH DAKOTA DOS (and Unix) pass two arguments into the program, an integer and a pointer to an array of pointers. The integer (argc) represents the number of paramaters on the command line. The pointer (argv) points to each paramater on the command line. Here are two examples: /* comline.c */ /* demonstrates commandline arguments */ main(argc, argv) int argc; char *argv[]; { int j; printf("Numer of arguments is %d\n", argc); for(j=0; j