home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / argv.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  1KB  |  61 lines

  1. /*
  2.  * GT CLIPPER STANDARD HEADER
  3.  *
  4.  * File......: argv.c
  5.  * Author....: Andy M Leighton
  6.  * BBS.......: The Dark Knight Returns
  7.  * Net/Node..: 050/069
  8.  * User Name.: Andy Leighton
  9.  * Date......: $Date$
  10.  * Revision..: $Revision$
  11.  *
  12.  * This is an original work by Andy Leighton and is placed in the
  13.  * public domain.
  14.  *
  15.  * Modification history:
  16.  * ---------------------
  17.  *
  18.  * $Log$
  19.  *
  20.  */
  21.  
  22. /*
  23.  *  $DOC$
  24.  *  $FUNCNAME$
  25.  *      GT_ARGV()
  26.  *  $CATEGORY$
  27.  *      Environment
  28.  *  $ONELINER$
  29.  *      Returns a command line parameter
  30.  *  $SYNTAX$
  31.  *      GT_argv(<nParam>) --> cParam
  32.  *  $ARGUMENTS$
  33.  *      <nParam>  -  The number of the parameter on the command line
  34.  *  $RETURNS$
  35.  *      <cParam>  -  The parameter asked for
  36.  *  $DESCRIPTION$
  37.  *      Return a command line parameter
  38.  *      Reads the C startup variable to find the specified parameter.
  39.  *
  40.  *      If <nParam> == 0, the function will return the name of the EXE
  41.  *      including it's path on non-prehistoric DOSes.
  42.  *  $EXAMPLES$
  43.  *      local i
  44.  *
  45.  *      for i := 0 to GT_Argc()
  46.  *          ? "Parameter Nº " + str(i, 2) + " = " + GT_Argv(i)
  47.  *      next
  48.  *  $CAVEATS$
  49.  *      Does not check <nParam> is a valid parameter.
  50.  *  $END$
  51.  */
  52.  
  53. #include "extend.h"
  54. extern char **__argv;
  55.  
  56. CLIPPER
  57. GT_argv()
  58. {
  59.   _retc(__argv[_parni(1)]);
  60. }
  61.