[comp.lang.pascal] Query - \"getopt\" in Turbo Pascal

mhg@mitre-bedford.arpa (Mark H. Granoff) (05/17/88)

>Does anyone have a Turbo Pascal (v3.0 or v4.0) implementation of the
>"getopt" command line option facility (standard under Unix). To refresh
>people's memories, v02i090 of comp.sources.misc was a copy of "getopt.c".
>I'd like to provide this same option interface to my Turbo Pascal programs.
>Please e-mail any responses. When I have received a usable implementation
>(or dreaded written it myself :-), I will post to this newsgroup. Thanks.

If memory serves, the getopt facility gets command line options,
right?  If thats the case, Turbo Pascal defines an integer variable,
ParamCount, and a string array, Param[], to get at this information.

I believe that ParamCount's range is 0 to n, where Param[0] is the
first string on the line (i.e. the invoked program's name), and
Param[1] through Param[n] are any command line arguments.

I may be missing something here; I have not used these facilities
personally but I have read about them and seen them used.  That's as
functional as this gets; there's probbaly more functionality in the
"traditional" getopt facility.

Hope this helps.

+--------------------------------------------------------------------+
| Mark H. Granoff                      Member of the Technical Staff |
+--------------------------------------------------------------------+
| USMAIL: The MITRE Corporation  | ARPAnet: mhg @ mitre-bedford.ARPA |
|         Burlington Rd.         | UUCP   : linus!mbunix!mhg         |
|         M/S B015               |-----------------------------------|
|         Bedford, MA 01730      | A T & T: (617) 271 - 7506         |
+--------------------------- Disclaimer -----------------------------+ 
|   The views expressed herein are my own and do not necessarily     |
|                    reflect those of my employer.                   |
+--------------------------------------------------------------------+