[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FN_SACCHOLD()
 Submit a hold request to an Object's account
------------------------------------------------------------------------------
 Syntax
      nResult := FN_sAccHold( cObjName,nObjType,nHold_Amt )
 
 Arguments
     <cObjName> is the name of the bindery object to request a hold against.
                Wildcards cannot be used.
     <nObjType> is the object type of the bindery object being held..
     <nHoldAmt> is the amount of the hold to request.

 Returns

      <nResult> is numeric value indicating the status of the request

                  0   = Successful
                192   = Object cannot submit charges
                193   = No account balance for object being charged
                194   = Credit limit exceeded
                195   = Object has too many holds


 Description

  This function attempts to submit a hold to an object in the bindery.
  In general, when a service wants to bill another bindery object, it
  should submit a hold against that objects account.  The hold amount
  is then reserved until a charge is submitted against the account in
  which case the hold will be removed.  If the SUBMIT hold fails, then
  the service request should be denied.

  An object can only submit charges if it's object ID is one entry
  in the SET property "ACCOUNT_SERVERS" on the file server where
  accounting is installed.

 Examples

   #define        CD_ROM_CHARGE     5.00
   #define        SERVER_TYPE          4
   #define        CONNECT_TIME         1
   #define        DISK_USAGE           2

   function UseCDrom(cObject,nType)
   //
   // Assumes your software is used to access the CD-ROM attached to the
   // network and you charge the accounts for it's use
   //
   ok := FN_sAccHold(cObject,nType,CD_ROM_CHARGE)   // Reserve the funds
   if ! ok
      Alert( "You do not have a enough funds!!")
      return .F.
   endif
   //
   //  Allow user to browse the CD_ROM file, limited to ten minutes
   //
   FN_sAccChg(cObject,nType,SERVER_TYPE,CD_ROM_CHARGE,;
                      CD_ROM_CHARGE,CONNECT_TIME, ;
                      { 10,;         // Ten minutes being charged
                        100,;        // Network requests
                        100000,;     // 100,000 bytes read
                             0 } }   // 0 bytes written
   return .T.



 Source: N:\SRC\ACCTNG\SACCHLD.PRG

 Author: Joseph D. Booth

See Also: FN_gAccSta() FN_sAccChg() FN_sAccNote()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson