Dec 062017
Returns the directory that the Clipper EXE was run from. Full source. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
ARG.C | 902 | 390 | deflated |
ARG.DOC | 2293 | 970 | deflated |
ARG.OBJ | 508 | 391 | deflated |
TESTARG.PRG | 584 | 230 | deflated |
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)
Suite 1014
Chattanooga, TN 37421
Files: ARG.DOC
ARG.C Source for _getargv(), _getargc()
ARG.OBJ Compiled version with Turbo C 2.0
TESTARG.PRG Clipper source to test the functions
Syntax:
Note:
number stored in Clipper because Clipper's includes
argv[0], 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!
- Skip
December 6, 2017
Add comments