home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / ACCTNG / ACINST.PRG next >
Text File  |  1993-02-23  |  2KB  |  92 lines

  1. /*
  2.  * File......: ACINST.PRG
  3.  * Author....: Glenn Scott
  4.  * CIS ID....: 71620,1521
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Glenn Scott and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *      fn_accInst()
  23.  *  $CATEGORY$
  24.  *      Accounting
  25.  *  $ONELINER$
  26.  *      Is Accounting installed?
  27.  *  $SYNTAX$
  28.  *     
  29.  *      fn_accInst( [<connId>] ) -> lInst
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *      <nConnID> (optional) - the connection ID of the file server
  34.  *      for which you are testing whether or not accounting is 
  35.  *      installed.  Defaults to your current preferred connection ID.
  36.  *
  37.  *      For more information on connection id's, see the fn_connid()
  38.  *      function.
  39.  *
  40.  *  $RETURNS$
  41.  *
  42.  *      .t. if accounting is installed; .f. if it isn't.
  43.  *
  44.  *  $DESCRIPTION$
  45.  *
  46.  *      This call determines whether or not accounting is installed
  47.  *      on a particular file server.  
  48.  *
  49.  *  $EXAMPLES$
  50.  *
  51.  *      qout( "Accounting is" + iif( fn_accInst(), "", " not" ) + ;
  52.  *            " installed." )
  53.  *
  54.  *  $SEEALSO$
  55.  *
  56.  *  $INCLUDE$
  57.  *
  58.  *  $END$
  59.  */
  60.  
  61. #include "netto.ch"
  62.  
  63. #ifdef FT_TEST
  64.    function main()
  65.       return qout( "Accounting is" + iif( fn_accInst(), "", " not" ) + ;
  66.                    " installed." )
  67. #endif
  68.  
  69. function fn_accInst( nConnID )
  70.    local nOld, cNm, lAcct := .f., lProp := .f.
  71.  
  72.    nOld := fn_pfconid()
  73.    default nConnID to nOld
  74.  
  75.    fn_spfcid( nConnID )
  76.  
  77.    cNm   := fn_fsname()[ nConnID + 1 ]
  78.    lAcct := ( fn_getFSI()[11] == 1 )      // Accounting version
  79.    lProp := !( fn_scaprop( cNm, OT_FILE_SERVER, "ACCOUNT_SERVERS" ) == nil )
  80.  
  81.    fn_spfcid( nOld )
  82.    return ( lAcct .and. lProp )
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.