home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / MSGSERV / BTOC.PRG < prev   
Text File  |  1993-02-23  |  2KB  |  84 lines

  1. /*
  2.  * File......: BTOC.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. #include "netto.ch"
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *     FN_BTOC()
  24.  *  $CATEGORY$
  25.  *     Message
  26.  *  $ONELINER$
  27.  *     Broadcast to file server console
  28.  *  $SYNTAX$
  29.  *
  30.  *     fn_btoc( cMsg ) -> lSuccess
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *    <cMsg>, a character string representing the message you want
  35.  *    to send to the file server console.  Can be no longer than 
  36.  *    60 characters.
  37.  *
  38.  *  $RETURNS$
  39.  *
  40.  *    Logical TRUE (.t.) if the call succeeds; FALSE (.f.) if it 
  41.  *    doesn't.  If it fails, you can check fn_error() for one of
  42.  *    the following:
  43.  *
  44.  *         252      Message queue is full
  45.  *         254      I/O failure due to lack of "dynamic workspace",
  46.  *                  whatever that means.  Isn't it enough to know
  47.  *                  it just didn't work?
  48.  *
  49.  *  $DESCRIPTION$
  50.  *     
  51.  *   Use this call to send a broadcast message to the file server
  52.  *   console.  This sends to the default server's console.
  53.  *   This would be useful for auditing, or for alerting the 
  54.  *   file server operator ("Load the backup tape!") or something
  55.  *   of that nature.
  56.  *
  57.  *   Good for letting network supervisors know your powerful 
  58.  *   Clipper app is running yet again.
  59.  *
  60.  *  $EXAMPLES$
  61.  *
  62.  *       fn_btoc( "Warning: Someone is using a Clipper app" )
  63.  *       
  64.  *  $INCLUDE$
  65.  *
  66.  *  $SEEALSO$
  67.  *     FN_SBM()
  68.  *  $END$
  69.  */
  70.  
  71.  
  72. function fn_btoc( cMsg )
  73.   local cReq, cRep
  74.  
  75.   default cMsg to "[netto]"
  76.   cMsg := iif( len( cMsg ) >= 60, subs( cMsg, 1, 60 ), cMsg )
  77.  
  78.   cReq := I2BYTE( 9 ) + I2BYTE( len( cMsg ) ) + cMsg
  79.   cRep := ""
  80.  
  81.   return ( _fnReq( 225, cReq, @cRep ) == 0 )
  82.  
  83.  
  84.