|Returns the directory that the Clipper EXE was run from. Full source.|
|File Name||File Size||Zip Size||Zip Type|
Download File ARGV.ZIP Here
Contents of the ARG.DOC file
- 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
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!
December 6, 2017 Add comments