[fpc-pascal]Re: About GetOpts and configuration file parsing
Yet Another Geek
yetanothergeek at yahoo.com
Sat Jul 13 08:29:37 CEST 2002
> well, I am not planning to allow -- at all, I don't
> so I suppose I can skip that row.
You can skip all of the argc and argv stuff, then -
All you need is this one line:
This tells getopts to use '/' for all single-char
> do you mean that any FPC program has defined argc
> (I suppose ParamCount returns this value, then)
"ParamCount" does not include the program name in its
but "argc" does. Thus "ParamCount" is always one less
Both of the indexes are zero-based .
( The program name is index zero )
Also note that Paramstr(0) returns the fully-qualified
the executable, where argv returns the actual
on the command line (it may or may not include the
So if you just typed "myprog" at the command prompt,
argv would be "myprog",
ParamStr(0) would be "C:\path\to\myprog.exe"
> and argv as an array of PChars that can be modified?
All of this is at least true for Linux,
I have not tested it with Windows or DOS.
- I will leave that up to you ;-)
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
More information about the fpc-pascal