- ARG.DOC -
Author: Paul 'Skip' Moon 615-899-1285
Moon Microsystems (Sponsor of Chattanooga
1920 Gunbarrel Rd. Clipper Users Group)
Chattanooga, TN 37421
ARG.C Source for _getargv(), _getargc()
ARG.OBJ Compiled version with Turbo C 2.0
TESTARG.PRG Clipper source to test the functions
Syntax: = _getargc()
= _getargv( )
Note: returned is one less than the actual
number stored in Clipper because Clipper's includes
argv, which is the executing program and its path.
Turbo C compile batch file is:
tcc -zAPROG -zBBSS -zCPROG -zDBSS -ml -c -zRDATA -zTDATA %1
Tlink command line:
tlink /n/x testarg+arg,,,\clipper\clipper;
To test it:
TESTARG one two three
I wrote this in response to a request on Nanforum for help in
retrieving the drive, path, and name of the executing file. The
problem with using CURDIR() is that it returns this information
about the Current path, which may not be the exe's path. An
example of this would be starting a program from another directory.
C:\> C:\EXEDIR\TESTARG one two three
This example starts the program, TESTARG, which resides in
C:\EXEDIR\, from the root directory.
Although it's sometimes fun to experiment or hack, wouldn't it be
so much better if Nantucket would sell (profit for them), or give
out documentation on the library? I can think of many, many useful
functions to write, if we could only interface directly with more
internal functions. Couldn't you? Maybe next version.
Mean while, Clipper is still my choice!