home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / OBJLISTS.PRG < prev    next >
Text File  |  1993-02-23  |  4KB  |  212 lines

  1. /*
  2.  * File......: OBJLISTS.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_FSLIST()
  24.  *  $CATEGORY$
  25.  *     Bindery
  26.  *  $ONELINER$
  27.  *     Get a sorted list of file server names
  28.  *  $SYNTAX$
  29.  *
  30.  *     fn_fslist() -> aList
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *     None
  35.  *
  36.  *  $RETURNS$
  37.  *
  38.  *     A sorted array of character strings corresponding to the
  39.  *     names of all known file servers found in the current 
  40.  *     file server's bindery.
  41.  *
  42.  *
  43.  *  $DESCRIPTION$
  44.  *
  45.  *     This call provides a simple way to pop up a list of file
  46.  *     server names.  Once the user selects one, you might need
  47.  *     the bindery object ID (which you can retrieve with the 
  48.  *     fn_gbndoid() call).
  49.  *
  50.  *  $EXAMPLES$
  51.  *
  52.  *     achoice( fn_fslist() )
  53.  *
  54.  *  $SEEALSO$
  55.  *
  56.  *  $INCLUDE$
  57.  *
  58.  *  $END$
  59.  */
  60.  
  61.  
  62. function fn_fslist()
  63.    return _fnNamList( OT_FILE_SERVER )
  64.  
  65. /*  $DOC$
  66.  *  $FUNCNAME$
  67.  *     FN_ULIST()
  68.  *  $CATEGORY$
  69.  *     Bindery
  70.  *  $ONELINER$
  71.  *     Get a sorted list of user names
  72.  *  $SYNTAX$
  73.  *
  74.  *     fn_ulist() -> aList
  75.  *
  76.  *  $ARGUMENTS$
  77.  *
  78.  *     None
  79.  *
  80.  *  $RETURNS$
  81.  *
  82.  *     A sorted array of character strings corresponding to the
  83.  *     names of all known users found in the current  file server's
  84.  *     bindery.
  85.  *
  86.  *
  87.  *  $DESCRIPTION$
  88.  *
  89.  *     This call provides a simple way to pop up a list of user
  90.  *     names.  Once the user selects one, you might need
  91.  *     the bindery object ID (which you can retrieve with the 
  92.  *     fn_gbndoid() call).
  93.  *
  94.  *  $EXAMPLES$
  95.  *
  96.  *     achoice( fn_ulist() )
  97.  *
  98.  *  $SEEALSO$
  99.  *    FN_FSLIST() FN_GRPLIST() FN_PRQLIST()
  100.  *  $INCLUDE$
  101.  *
  102.  *  $END$
  103.  */
  104.  
  105.  
  106. function fn_ulist()
  107.    return _fnNamList( OT_USER )
  108.  
  109. /*  $DOC$
  110.  *  $FUNCNAME$
  111.  *     FN_GRPLIST()
  112.  *  $CATEGORY$
  113.  *     Bindery
  114.  *  $ONELINER$
  115.  *     Get a sorted list of user groups
  116.  *  $SYNTAX$
  117.  *
  118.  *     fn_grplist() -> aList
  119.  *
  120.  *  $ARGUMENTS$
  121.  *
  122.  *     None
  123.  *
  124.  *  $RETURNS$
  125.  *
  126.  *     A sorted array of character strings corresponding to the
  127.  *     names of all known user groups found in the current file server's
  128.  *     bindery.
  129.  *
  130.  *
  131.  *  $DESCRIPTION$
  132.  *
  133.  *     This call provides a simple way to pop up a list of user
  134.  *     groups.  Once the user selects one, you might need
  135.  *     the bindery object ID (which you can retrieve with the 
  136.  *     fn_gbndoid() call).
  137.  *
  138.  *  $EXAMPLES$
  139.  *
  140.  *     achoice( fn_grplist() )
  141.  *
  142.  *  $SEEALSO$
  143.  *    FN_FSLIST() FN_ULIST() FN_PRQLIST()
  144.  *  $INCLUDE$
  145.  *
  146.  *  $END$
  147.  */
  148.  
  149. function fn_grplist()
  150.    return _fnNamList( OT_USER_GROUP )
  151.  
  152. /*  $DOC$
  153.  *  $FUNCNAME$
  154.  *     FN_PRQLIST()
  155.  *  $CATEGORY$
  156.  *     Bindery
  157.  *  $ONELINER$
  158.  *     Get a sorted list of print queue names
  159.  *  $SYNTAX$
  160.  *
  161.  *     fn_prqlist() -> aList
  162.  *
  163.  *  $ARGUMENTS$
  164.  *
  165.  *     None
  166.  *
  167.  *  $RETURNS$
  168.  *
  169.  *     A sorted array of character strings corresponding to the
  170.  *     names of all known print queues found in the current
  171.  *     file server's bindery.
  172.  *
  173.  *
  174.  *  $DESCRIPTION$
  175.  *
  176.  *     This call provides a simple way to pop up a list of print
  177.  *     queue names.  Once the user selects one, you might need
  178.  *     the bindery object ID (which you can retrieve with the 
  179.  *     fn_gbndoid() call).
  180.  *
  181.  *  $EXAMPLES$
  182.  *
  183.  *     achoice( fn_prqlist() )
  184.  *
  185.  *  $SEEALSO$
  186.  *    FN_FSLIST() FN_GRPLIST() FN_ULIST()
  187.  *  $INCLUDE$
  188.  *
  189.  *  $END$
  190.  */
  191.  
  192. function fn_prqlist()
  193.    return _fnNamList( OT_PRINT_QUEUE )
  194.  
  195. /* ------------------------------------------------------------------ */
  196.  
  197. function _fnNamList( xType )
  198.    local aArr
  199.    local aRes := {}
  200.  
  201.    aArr := fn_scabndo( "*", xType )
  202.    if !empty( aArr )
  203.       aeval( aArr, { |x| aadd( ARes, x[1] ) } )
  204.       asort( aRes )
  205.    endif
  206.  
  207.    return aRes
  208.  
  209.  
  210.  
  211.  
  212.