home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / NETWORK / GP25.ZIP / GPLIB.DOC < prev    next >
Text File  |  1994-03-24  |  160KB  |  4,817 lines

  1. Software License
  2.  
  3. This license permits you to use the software (GPLIB) under the terms of this license.  Ownership of the software including the programs, documentation, and any other materials provided with the program, and any components thereof ("LICENSED SOFTWARE") remains with MH Software ("LICENSOR").
  4.  
  5. The LICENSED SOFTWARE is owned by LICENSOR, is protected by a registered copyright belonging to LICENSOR and is protected by United States copyright laws and international copyright treaty provisions.
  6.  
  7. You may install GPLIB on one computer or network file server for software development purposes.  If you wish to use GPLIB for development on more than one computer or server, you must purchase additional licenses or obtain a site license.
  8.  
  9. You may distribute GPLIB as part of your software, provided you do so within the following 
  10. conditions:
  11.     
  12. GPLIB.PLB may only be distributed as part of a compiled FoxPro .APP file or FoxPro .EXE file.  
  13. GPLIB.FLL may be distributed separately with your .APP or .EXE file.  If you deliver source-code to your customer, and your customer, or his agent will make modifications to customers program, then the customer must purchase GPLIB.  You may distribute the unregistered version of GPLIB provided that all accompanying documentation and files are included.  If your program uses GPLIB, and you wish to distribute it with your source code, without requiring your customers to register GPLIB, then you must purchase a distribution license.
  14.  
  15. You may not reverse engineer, decompile, or disassemble the software.  You may not copy (except for backup purposes), sell or otherwise distribute (except within the terms described above) this software.
  16.  
  17. You may not share, post on any bulletin board system, or otherwise distribute your GPLIB activation key.
  18.  
  19. Limits of Liability
  20.  
  21. LICENSOR makes no warranty of any kind, expressed or implied, with regard to the program or documentation contained in this product.  EXCEPT AS EXPRESSLY SET FORTH HEREIN, LICENSOR DISCLAIMS ANY AND ALL PROMISES, REPRESENTATIONS, AND WARRANTIES WITH RESPECT TO THE LICENSED SOFTWARE, INCLUDING THE CONDITION, THE CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, THE EXISTENCE OF ANY ERRORS OR OTHER LATENT OR PATENT DEFECT, ANY INFRINGEMENT OF ANYONE ELSE'S INTELLECTUAL PROPERTY RIGHTS, ANY NEGLIGENCE, THE MERCHANTABILITY OF THE LICENSED SOFTWARE, AND FITNESS FOR ANY PARTICULAR USE.  LICENSOR SHALL NOT BE LIABLE IN ANY EVENT FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER LOSS) IN CONNECTION WITH OR ARISING OUT OF THE USE OF THIS PROGRAM.  UNDER NO CIRCUMSTANCES SHALL LICESNOR'S LIABILITY EXCEED THE COST PAID FOR THE SOFTWARE, EVEN IF LICENSOR HAS BEEN ADVISED OF THIS POSSIBILITY.
  22.  
  23. This agreement shall be construed and enforced in accordance with the laws of the State of Colorado.  Any action or proceeding brought by either party against the other arising out of or related to the Agreement shall be brought only in a State or Federal Court of competent jurisdiction located in the City and County of Denver, Colorado.  The parties hereto agree to in personam jurisdiction of said courts.  You agree that should you breach this agreement, said breach will cause imminent harm to LICENSOR and that LICENSOR has no adequate remedy at law, and that injunctive relief is appropriate.  You also agree that if you should breach this agreement, LICENSOR shall be entitled to reasonable costs including attorneys' fees in any action to enforce any provision of the agreement.  This agreement is the full integration of the understanding between the parties thereto.
  24.  
  25. Defective Media
  26.  
  27. If within ninety (90) days of receipt of this software, the distribution media is found to be defective, you may receive replacement media for no charge.  After 90 days there will be a nominal shipping and handling  fee.
  28.  
  29. Customer Remedies
  30.  
  31. LICENSOR'S entire liability and your exclusive remedy shall be, at LICENSOR'S option, either (a) return of the price paid for the software, or (b) repair or replacement of defective media.
  32.  
  33. Trademarks
  34.  
  35. FoxPro and  MSDOS are registered trademarks and Windows is a trademark of Microsoft Corporation.  NetWare is a registered trademark of Novell, Inc.  GPLIB is a trademark of LICENSOR.
  36.  
  37. Shareware
  38.  
  39. GPLIB is shareware.  This means that you may test this software to determine if it fits your needs.  If you find it is useful to you, you must register this software by filling out the enclosed registration form and returning it with your payment.  If you find this software is not useful to you, you must remove this software from all computers it is installed on.
  40.  
  41. ───────────────────────────────────
  42.  
  43. See Also:  Registration Information
  44.  
  45. ───────────────────────────────────
  46.  
  47. License Q&A
  48.  
  49. Q:    I would like to install GPLIB on my network.  I have 100 programmers attached to the network who will be accessing GPLIB.  How many licenses do I need?
  50.  
  51. A:    You need only purchase one license.  The GPLIB license agreement allows it to be installed on one computer or one network server.
  52.  
  53. Q:    I have 20 programmers.  Each programmer needs GPLIB installed on their own PC.  How many licenses do I need?
  54.  
  55. A:    You need to purchase 20 licenses.  The GPLIB license agreement allows it to be installed on one computer or network server.  In this case because you wish to install it on 20 computers you need 20 licenses.  You can contact MH Software for a quantity pricing schedule.
  56.  
  57. Q:    I am doing some contract work for a client.  I have registered GPLIB.  After I complete the work, their people will take over maintenance of the software.  Can I distribute my copy of  GPLIB to them?
  58.  
  59. A:    No.  In this case, your client will need to purchase a license to use GPLIB.  The license permits you to distribute GPLIB as part of a compiled application.  In this case, since the library would be used by a third party for development, they must license the software.
  60.  
  61. Q:    I am selling a FoxPro add-in product.  My product would benefit greatly from incorporation of GPLIB.  When I distribute my product I will distribute the source code, and would like to include a registered version of GPLIB for use by other developers.  If I register GPLIB, may I distribute it with my product?
  62.  
  63. A:    No.  The license for GPLIB allows you to distribute it only as part of a compiled application.  If you wish to distribute GPLIB you must contact MH Software for a distribution license.  You may distribute the unregistered version of GPLIB with your product provided that all accompanying documentation including license, manual, and sample programs are included.
  64.  
  65. Q:    My company is developing a dry-cleaning vertical market application.  We estimate sales will be 10,000 units per month.  We would like to use GPLIB in our product.  The application will only be distributed in compiled form.  There will not be any VARs or other intermediaries who will have access to the source code.  How many licenses do we need?
  66.  
  67. A:    Most likely you need only one license.  The license for GPLIB restricts how many machines it can be installed upon for development purposes.  You may distribute an unlimited number of  copies of GPLIB as long as it is part of the compiled application.
  68.  
  69. Registration Information
  70.  
  71. GPLIB is Shareware.  You may test GPLIB, but if you continue to use it, you must register.
  72.  
  73. Registered users of GPLIB get free updates via CompuServe.  When you register, you will be given a serial number and an activation key.  You can use this to register the latest version of the software as it is placed on CompuServe.  For example: you  register GPLIB, two months later, when a new version is released, you can download the new files from CompuServe.  You can then register the new program  using the Serial Number and Activation Key you were given at registration.
  74.  
  75. Registered users also receive a bound, printed manual, and a diskette containing the most current version of GPLIB.
  76.  
  77. Shipping
  78.  
  79.     MAIL
  80.     
  81.         Normal US Shipment is via 2nd Day US Mail.  Normal International Shipment is via small-packet air mail.  Delivery times to Europe average about 7 days
  82.         
  83.     Federal Express
  84.     
  85.         Shipment via Federal Express is also available.  If you desire next day shipment or traceable shipment your order should be sent via Federal Express.
  86.         
  87.     
  88. Electronic Notification
  89.  
  90.     If you include your Internet or Compuserve ID with your registration, you will also electronically receive your serial number and activation key.
  91.     
  92. Purchase Orders
  93.  
  94.     Purchase orders are accepted from US and Canadian companies and foreign subsidiaries of US companies.  You may fax your purchase order to (303) 469-9679.  Payment terms are Net 30. 
  95.     
  96. Turnaround Time
  97.  
  98.     Generally, all orders are processed the same day they are received.  If your order is received by 3:00 MST, you will receive electronic notification that day, and your order within the time specified in the shipping section.
  99.  
  100. Credit Cards
  101.  
  102.     We accept Visa and Master Card for payment.  To order using your Visa or Master Card, please complete the credit card ordering information section.
  103.  
  104.     
  105.                                GPLIB Registration Form
  106.  
  107.  
  108. Name:  ___________________________  Compuserve ID (Optional) _______________
  109.  
  110. Company:  ________________________________  Phone:   _______________________
  111.  
  112. Address: ___________________________________________________________________
  113.  
  114. City:_________________________________ State:  _________  Zip: ____________
  115.  
  116. Country:  _______________________
  117.  
  118.  
  119. GPLIB for FoxPro
  120. 2.X DOS and Windows        Qty:  ____________  * $99.00  =   __________________
  121.  
  122. ******************* BONUS OFFER  *********************
  123.  
  124. Are you tired of spending time re-indenting your source code?  Would
  125. you like to see your program graphically outlined, but don't want to
  126. use FoxDoc?  Do you want to re-indent an entire project without pulling
  127. each file up?  If you answered yes to any of these questions, you need 
  128. Indent!  Indent! is the most complete source code beautification program 
  129. available.  It's many advanced features will save you hours of time.  
  130.  
  131. For a limited time, order Indent! with GPLIB and get a 25% discount.
  132.  
  133. YES I want to save time!  Send me Indent! for 25% off the regular price:
  134.  
  135. Indent! Single User     Qty:  _____________  * $36.75  =   _________________
  136.  
  137. Indent! Server License  Qty:  _____________  * $74.25  =   _________________
  138.  
  139. *****************************************************
  140.  
  141. Ship Via:  ( ) US/International Mail
  142.  
  143.                US, Canada & Mexico      $5.00
  144.                All Others             $10.00
  145.                
  146.            ( ) Federal Express*
  147.            
  148.                   US Next Day            $15.50
  149.                   US Priority            $22.50
  150.                   Alaska & Hawaii add   $5.00
  151.                   Canada Next Day        $33.00
  152.                All others call for pricing
  153.                                    
  154. *Freight costs are quoted based on one copy of GPLIB.
  155.  For each additional product add $4.00
  156.  
  157.                                                 Shipping    ________________
  158.  
  159.                                                 Sub-Total   ________________
  160.  
  161. Colorado residents add 4.3% Sales Tax                       ________________
  162.  
  163.                                                  Total      ________________
  164.  
  165. Payment must be a check in US dollars drawn on a US bank, or Money Order in US dollars.  Make Check payable to MH Software.
  166.  
  167. Please return this form along with your payment to:
  168.  
  169.     MH Software
  170.     1006 W 104th Ave #200
  171.     Northglenn, CO 80234
  172.  
  173. or FAX your purchase order and this form to (303)469-9679.
  174.  
  175.  
  176.                     Credit Card Ordering Information
  177.  
  178. Account # ________________________________ Exp Date (MM/YY) ________________
  179.  
  180. Card Holder Name ___________________________________________________________
  181.  
  182. Card Type (Circle One)        Visa    MC
  183.  
  184. Authorized Signature _____________________________________
  185.  
  186. Enhancement Requests
  187.  
  188. We welcome your requests for enhancements.  MH Software is dedicated to providing the finest FoxPro enhancement tools available.  We need your input to let us know how we can improve our products.  If you have an idea for an enhancement, please contact us.  When you do, please be sure to provide your daytime telephone number in the event that we need to contact you for clarification.  Please forward all requests for enhancements to CompuServe mail ID 73237,1665 or mail them to:
  189.  
  190.         MH Software
  191.         1006 W 104th Ave #200
  192.         Northglenn, CO 80234
  193.  
  194.  
  195. ───────────────────────────────────
  196.  
  197. See Also:  Upgrades
  198.  
  199. ───────────────────────────────────
  200.  
  201. Upgrades
  202.  
  203. With the registration of GPLIB, you are entitled to free same-version updates.  This means you are entitled to free updates for versions of GPLIB for FoxPro 2.5 (DOS and Windows).  These free updates can be obtained via download from CompuServe.  The latest version of GPLIB is available on the Microsoft FoxPro Support Forum (GO FOXFORUM).  You can download the latest version from this forum as soon as it is made available.  After you download them, use the REGISTER utility program to enter your serial number, activation key and registration information into the library.  The registration process will suppress demonstration version messages.  If you are unable to download the file from CompuServe, you can obtain an upgrade disk for $10.00.  Mail your check or money order to:
  204.  
  205.         MH Software
  206.         1006 W 104th Ave #200
  207.         Northglenn, CO 80234
  208.  
  209. ───────────────────────────────────
  210.  
  211. See Also:  Registration Program
  212.  
  213. ───────────────────────────────────
  214.  
  215. Technical Support
  216.  
  217. Every effort has been made to ensure this software is free of defects.  If you find a bug in this program we will make every effort to fix the problem and provide you with an updated program.  You may contact technical support via CompuServe mail @73237,1665, via Internet at 73237.1665@compuserve.com, by calling (303) 438-9585, or via mail at:
  218.  
  219.     MH Software
  220.     1006 W 104th Ave #200
  221.     Northglenn, CO 80234
  222.  
  223.  
  224. General Info About GPLIB
  225.  
  226.     GPLIB is a general purpose FoxPro 2.5 API Library.  It has several general purpose DOS & PC related functions as well as over 75 NetWare specific commands.  In order for the NetWare functions to work you must be using NetWare 2.1X or higher.  These functions will not work with NetWare Lite or NetWare Personal Edition.
  227.  
  228.     If you are using FoxPro to view this document you may need to set WORD WRAP on in your Edit/Preferences.
  229.  
  230. Error Handling and GPLIB
  231.  
  232.     In most instances, I have relied on the FoxPro API _UserError function.  The function will generate error 1098, and return a descriptive error text message, rather than having the function return a number that must be interpreted.  An example of this is an attempt to map a drive to a file server you are not connected to: N_MapDrive('sys:','G','ENGINEERING'), if you are not attached to server ENGINEERING, FoxPro's Error() function will return 1098, and the message function will return "Not attached to server ENGINEERING".  Hopefully, this reduces the amount of error trapping you have to code into your application.  In my programming I rely entirely on Pat Adams ProError error handler.  If you are not using ProError, I recommend you download it and try it.
  233.  
  234. NetWare Security and GPLIB
  235.  
  236.     Certain functions require that the person executing be either the network supervisor, or equivalent.  An example of this is N_PwdDate().  I can use this function to get my password date, but I cannot use it to get another persons password date UNLESS:  1)  I am SUPERVISOR or equivalent, 2)  I am security equivalent to that person, 3)  I am a manager over that person.  This generally applies to N_SecEquiv(), N_PwdDate(), N_AccsDate(), etc., those functions which read the NetWare bindery for specific user information.  Also, some functions such as N_LIStat() require that the person executing them be either a supervisor, or a console operator.
  237.  
  238. Manual Translations
  239.  
  240.     MH Software recognizes that not all FoxPro programmers speak English.  At the same time we are constrained to keep costs down to make this product work as shareware.  To that end, permission is granted for FoxPro user groups with non-English speaking members to translate and publish this manual.  The following restrictions apply.  1)  You must notify MH Software that you are beginning a translation effort and the language(s) you are translating to.  2)  The manual must be reproduced in it's entirety including the License Agreement, all copyright notices, registration forms, and all sample code.    3)  You must notify MH Software when you have completed and published your translation.  4)  You grant MH Software permission to list your User Group as a source of a translated manual.  5)  You agree to send MH Software three (3) copies of the completed manual, once printed.
  241.  
  242. What's New Since V2.54
  243.  
  244.     N_DrvDepth()
  245.     
  246.         Function to return relative drive depth for a drive that has a "fake root" mapping.
  247.         
  248.     N_GetLocks()  
  249.     
  250.         Function to return the file/records locks applied to a particular file.
  251.         
  252.     N_Login()
  253.     
  254.         Corrected error that wouldn't allow GPLIB to use the 8th slot of the NetWare shell for logins.
  255.  
  256.     N_StPParms()
  257.     
  258.         Added additional error checking to ensure that a queue and server name are passed.
  259.  
  260.     N_LogOff()
  261.     
  262.         Added additional documentation to clarify usage.
  263.  
  264. What's New Since V2.53
  265.  
  266.     N_CUsing()
  267.     
  268.         Function to return a list of connections that have a specified file open.
  269.  
  270.     N_DrvList()
  271.     
  272.         Function to return list of available drives.
  273.  
  274.     N_TrustLst()
  275.     
  276.         Function to return a list of trustees for a specified file or directory.
  277.     
  278.     N_TrustMod()
  279.     
  280.         Function modify trustee rights to a directory or file.
  281.         
  282.     N_TrustRem()
  283.     
  284.         Function to remove trustee rights from a directory or file.
  285.         
  286.     N_StPParms()
  287.     
  288.         N_StPParms() now implicitly performs N_FlushLPT().  This corrects problems some users were having when using N_StPParms() when there was an active printjob.
  289.  
  290.     Demo Message
  291.     
  292.         Fixed problem that caused the Demonstration version message to appear on the .FLL version on subsequent loads.  The problem was caused by Windows not unloading the .FLL file (DLL) between runs.
  293.  
  294. What's New Since V2.52
  295.  
  296.     Fixed bug where N_RdPParms() & N_StPParms() were not properly handling the formfeed flag, and the AutoEndCap Flag.
  297.  
  298.     Fixed bug in N_Snd2Serv() that could result in occasionally sending extra characters in the message.
  299.  
  300.     Fixed Documentation for N_Login().
  301.     
  302.     
  303. What's new since V2.51
  304.  
  305. The following functions have been renamed or modified:
  306.  
  307.     Old Name        New Name
  308.  
  309.     N_Attach()        N_ServAtch()
  310.     N_Brd2Cons()    N_Snd2Serv()
  311.     N_BrdFCons()    N_SndFServ()
  312.     N_Capture()        N_CapMode()
  313.     N_Cast()        N_MsgMode()
  314.     N_Date()        N_ServDate()
  315.     N_Detach()        N_ServDtch()
  316.     N_DfServer()    N_DefServr()
  317.     N_Equivs()        Syntax change for compatibility with N_GrpMbrs()
  318.     N_FlagTran()    No longer supported.  See N_SetAttr()
  319.     N_FullName()    N_UserName()
  320.     N_GetBMode()    N_MsgMode()
  321.     N_GetBMsg()        N_MsgRtrv()
  322.     N_GetMATyp()    N_LongMach()
  323.     N_GetOSVer()    No longer supported.
  324.     N_GetOSTyp()    No longer supported.
  325.     N_GetPath()        N_DrvPath()
  326.     N_GetPStat()    N_RdPParms()
  327.     N_GetSMTyp()    N_ShrtMach()
  328.     N_GroupsIn()    Syntax change for compatibility with N_GrpMbrs()
  329.     N_IsAttach()    N_Attached()
  330.     N_IsEquiv()        N_SecEquiv()
  331.     N_IsLogged()    N_LoggedIn()
  332.     N_IsMap()        No longer supported.  See N_ServFrDr()
  333.     N_IsMember()    N_MemberOf()
  334.     N_IsNWBoss()    N_ConsOper()
  335.     N_LastLog()        N_AccsDate()
  336.     N_LocDrv()        N_DriveCnt()
  337.     N_LogDate()        N_LogInfo()
  338.     N_LoginFS()        N_Login()
  339.     N_Logout()        N_LogOff()
  340.     N_LogoutFS()    N_LogOff()
  341.     N_LogTime()        N_LogInfo()
  342.     N_Map()            N_MapDrive()
  343.     N_MapRem()        N_MapDel()
  344.     N_MapRoot()        Syntax change for compatibility with N_MapDrive()
  345.     N_Members()        N_GrpMbrs()
  346.     N_NoLogin()        N_LIStat()
  347.     N_NWVers()        N_ServVers()
  348.     N_OkLogin()        N_LIStat()
  349.     N_PJobList()    N_LstQJobs()
  350.     N_PJobMove()    N_MoveQJob()
  351.     N_PJobRem()        N_DelQJob()
  352.     N_Semaphor()    N_SetSem()
  353.     N_SendMsg()        N_MsgBrd()
  354.     N_ServerID()    No Longer Supported.  See N_Servers()    
  355.     N_ServFrID()    No longer supported.  See N_Servers()
  356.     N_ServName()    N_ServFrDr()
  357.     N_SetPStat()    N_StPParms()
  358.     N_StaID()        N_ConnNum()
  359.     N_Time()        N_ServTime()
  360.     N_TTSEnd()        N_TTSCommt()
  361.     N_TTSZap()        N_TTSRollB()
  362.  
  363.     N_FileInfo()
  364.     
  365.         Function to read extended NetWare attributes of a file.
  366.         
  367.     N_SetAttr()
  368.     
  369.         Function to set extended NetWare attributes of a file.
  370.         
  371.     IsDiskIn()
  372.     
  373.         Function now returns .T. if a fixed disk is specified.
  374.         
  375.     N_CapMode()
  376.         
  377.         Supports new parameter to discard current print job.
  378.         
  379.     N_RdPParms()
  380.     
  381.         Supports setting and clearing AutoEndCap flag.
  382.  
  383. How To Access GPLIB
  384.  
  385.     To use the commands in GPLIB you must first issue the command:
  386.  
  387.         SET LIBRARY TO GPLIB
  388.  
  389.     This loads the library and allows FoxPro to access the functions contained inside it.  For information on how to use each individual function, please refer to the documentation following this page.  Once the SET LIBRARY TO GPLIB command has been issued, you can see a list of all the GPLIB functions by typing DISPLAY STATUS.  For some additional information on SET LIBRARY TO, refer to the FoxPro help file for SET LIBRARY.
  390.  
  391.     To make GPLIB, and GPHELP more readily available to FoxPro, you may want to add a statement to your CONFIG.FP that sets a path to the directory containing them, i.e.:
  392.  
  393.         PATH = C:\FOXPRO25\API
  394.  
  395.     You could then access GPLIB by typing SET LIBRARY TO GPLIB without specifying the full path.  Similarly, you could SET HELP TO GPHELP without specifying the full path.
  396.  
  397. About MakeHelp.PRG
  398.  
  399.     The MakeHelp program included with GPLIB will convert this document into a FoxPro 2.5 compatible help file.  This allows you to use the FoxPro Help system to access information about the commands stored in GPLIB.
  400.  
  401.     To create the Help database, from the command window type DO MAKEHELP.  The program will then create the database.
  402.  
  403.     In later sessions, to access the GPLIB help database you can issue the command SET HELP TO GPHELP.  When the FoxPro HELP function is invoked by pressing F1, or typing help, the GPLIB information will be available.
  404.  
  405.     To restore the HELP function to the standard FoxPro Help file, issue the command:
  406.     
  407.         SET HELP TO
  408.  
  409. Registration Program
  410.  
  411.     GPLIB comes with a registration program named REGISTER.EXE.  This program is used to embed the registration information into GPLIB.  Once this program is ran, the demonstration version message will stop being displayed.
  412.  
  413.     To use the program, from the DOS Prompt type:
  414.  
  415.         REGISTER GPLIB.PLB GPLIB.FLL
  416.  
  417.     You will be prompted to enter your serial number and activation key.  Once these are entered, you will be prompted to enter your registration information.  This information will be embedded in the library.  Once embedded, it can be displayed using ABOUTGPLIB().
  418.  
  419. Function List for GPLIB
  420.  
  421.     This section contains a list of all the functions that are contained in GPLIB.  For specific information on how to use each command, refer to the documentation for that specific command.
  422.  
  423.  
  424.     AboutGPLIB()    -    Return version information for GPLIB
  425.     AMPM()            -    Function to return time as character string with AM or PM appended.
  426.     ColdBoot()        -    Coldboot a computer.
  427.     CtlAltShft()    -    Return true if Control, Alt, or Shift key is held down
  428.     ElapseTime()    -    Function to return difference in minutes between two time strings.
  429.     FileCount()        -    Function to return # of matching files in a directory.
  430.     FindFirst()        -    Function to perform a DOS find first/find next.
  431.     Flag()            -    Set DOS file attributes.
  432.     GenError()        -    Function to generate a FoxPro error.
  433.     IsDiskIn()        -    Function to return whether a disk is in the floppy drive specified.
  434.     Make_Dir()        -    Create directory.
  435.     Math_Chip()        -    Return true if a 80x87 math coprocessor is installed.
  436.     MReset()        -    Perform mouse reset & return number of buttons.
  437.     Num_Serial()    -    Return Number of Serial Ports
  438.     N_AccsDate()    -    Return last login date & time for a user.
  439.     N_AcctList()    -     Return list of user accounts from server.
  440.     N_Attached()    -    Return whether attached to a server.
  441.     N_CapMode()        -    Toggle capture on or off.
  442.     N_ChgPwd()        -    Change Bindery Object Password
  443.     N_ChkOwner()    -    Check/Set ownership of specified files.
  444.     N_ClearSta()    -    Clear Specified Connection Number
  445.     N_ConnNum()        -    Return NetWare station number.
  446.     N_ConsOper()    -    Return whether workstation is a console operator
  447.     N_CUsing()        -    Return list of stations using a specified file.
  448.     N_DefServr()    -    Change default server.    
  449.     N_DelQJob()        -    Function to remove a print job from a queue.
  450.     N_DirInfo()        -    Return directory owner and rights mask.
  451.     N_DriveCnt()    -    Return number of logical local drives.
  452.     N_DrvDepth()    -    Return relative drive depth for "fake root" drives.
  453.     N_DrvList()        -    Return list of available drives.
  454.     N_DrvPath()        -    Return Path for a drive letter.
  455.     N_Equivs()        -    Return list of objects the specified user is equivalent to.
  456.     N_FlushLPT()    -    Flush capture of specified LPT port.
  457.     N_GetGroup()    -    Return list of groups from server.
  458.     N_GetLocks()    -    Return list of record/file locks for a file.
  459.     N_GetQList()    -    Return List of Queues from server.
  460.     N_GetSList()    -    Return List of Servers from the file server.
  461.     N_GetWild()        -    Get List Of all bindery objects from server.
  462.     N_GroupsIn()    -    Returns list of groups a specified user is in.
  463.     N_GrpMbrs()        -    Return list of members for specified group.
  464.     N_LIStat()        -    Read/Set the login state of the server
  465.     N_LoggedIn()    -    Return whether specified user is logged into the network.
  466.     N_Login()        -    Login to a file server.
  467.     N_LogInfo()        -    Return Login date or time for a station.
  468.     N_LogOff()        -    Logout of specified file server.
  469.     N_LongMach()    -    Get Long Machine Type
  470.     N_LstQJobs()    -    Function to create an array containing print jobs for the specified queue.
  471.     N_MapDel()        -    Delete A drive mapping
  472.     N_MapDrive()    -    Map a drive
  473.     N_MapRoot()        -    Map root command.
  474.     N_MaxConns()    -    Return Maximum NetWare connections.
  475.     N_MemberOf()    -    Return Group Membership
  476.     N_MoveQJob()    -    Function to move print job within a print queue.
  477.     N_MsgBrd()        -    Send a message to another network user.
  478.     N_MsgMode()        -    Return current station broadcast mode.
  479.     N_MsgRtrv()        -    Retrieve a stored message from the file server.
  480.     N_PwdDate()        -    Return date users password expires.
  481.     N_RdPParms()    -    Get current Capture Settings
  482.     N_SecEquiv()    -    Return Security Equivalence
  483.     N_SerialNo()    -    Return server NetWare serial number.
  484.     N_ServAtch()    -    Attach to a file server.
  485.     N_ServDate()    -    Return File Server Date
  486.     N_ServDtch()    -    Detach from file server
  487.     N_Servers()        -    Create list of servers currently logged into.
  488.     N_ServFrDr()    -    Return file server name for a mapped drive
  489.     N_ServTime()    -    Return File Server Time
  490.     N_ServVers()    -    Return NetWare version number.
  491.     N_SetAttr()        -    Set extended attributes on a NetWare file.
  492.     N_SetDots()        -    Set SHOW DOTS on or off, or return current value.
  493.     N_SetSem()        -    Perform Network semaphore locking.
  494.     N_ShellVer()    -    Return Shell Version
  495.     N_ShrtMach()    -    Get Short Machine Type
  496.     N_Snd2Serv()    -    Broadcast message to server console.
  497.     N_SndFServ()    -    Broadcast message from server console.
  498.     N_StaAddr()        -    Return Physical station Address
  499.     N_StPParms()    -    Modify Current capture settings.
  500.     N_SYSTime()        -    Synchronize stations clock to server.
  501.     N_TrustLst()    -    Return trustee list for a file or directory.    
  502.     N_TrustMod()    -    Modify Trustee rights to file or directory.
  503.     N_TrustRem()    -    Remove trustee rights to a file or directory.
  504.     N_TTSAvail()    -    Return / Set TTS Availability
  505.     N_TTSBegin()    -    Begin a TTS Transaction
  506.     N_TTSCommt()    -    End a TTS Transaction
  507.     N_TTSRollB()    -    Rollback a TTS Transaction
  508.     N_TTSStat()        -    Return status of a completed transaction
  509.     N_UserID()        -    Return NetWare User ID
  510.     N_UserBnnr()    -    Read/Set User Banner Name
  511.     N_UserName()    -    Return users full name
  512.     N_VerPwd()        -    Verify a users password
  513.     N_Volumes()        -    Create array of mounted volumes.
  514.     Rem_Dir()        -    Remove a directory
  515.     SetMLimit()        -    Set Mouse Limits
  516.     SetMPos()        -    Set Mouse Cursor Position
  517.     ShftPrtScr()    -    Invoke Hardware Interrupt 5 (Shift-Printscreen)
  518.     TrimLen()        -    Return Trimmed Length of a String
  519.     UniqueName()    -    Return unique file name
  520.  
  521. ───────────────────────────────────
  522.  
  523. See Also:     Bindery Functions,  Message Functions,  Miscellaneous Functions,  Printer Functions,  Server Functions,  Station Functions,  TTS/Semaphore Functions
  524.  
  525. ───────────────────────────────────
  526.  
  527.  
  528. Bindery Functions
  529.  
  530.     N_AccsDate()    -    Return last login date & time for a user.
  531.     N_AcctList()    -     Return list of user accounts from server.
  532.     N_ChgPwd()        -    Change Bindery Object Password.
  533.     N_ChkOwner()    -    Check/Set ownership of specified files.
  534.     N_Equivs()        -    Return list of objects the specified user is equivalent to.
  535.     N_GetGroup()    -    Return list of groups from server.
  536.     N_GetWild()        -    Get list of all bindery objects from server.
  537.     N_GroupsIn()    -    Returns list of groups a specified user is in.
  538.     N_GrpMbrs()        -    Return list of members for specified group.
  539.     N_MemberOf()    -    Return Group Membership
  540.     N_PwdDate()        -    Return date users password expires.
  541.     N_SecEquiv()    -    Return Security Equivalence
  542.     N_TrustLst()    -    Return trustee list for a file or directory.    
  543.     N_TrustMod()    -    Modify Trustee rights to file or directory.
  544.     N_TrustRem()    -    Remove trustee rights to a file or directory.
  545.     N_UserName()    -    Return users full name
  546.     N_VerPwd()        -    Verify a user's password
  547.  
  548. ───────────────────────────────────
  549.  
  550. See Also:    N_AccsDate(), N_AcctList(), N_ChgPwd(), N_ChkOwner(), N_Equivs(), N_GetGroup(), N_GetWild(), N_GroupsIn(), N_GrpMbrs(), N_MemberOf(), N_PwdDate(), N_SecEquiv(), N_TrustLst(), N_TrustMod(), N_TrustRem(), N_UserName(), N_VerPwd()
  551.  
  552. ───────────────────────────────────
  553.  
  554. Message Functions
  555.  
  556.     N_MsgBrd()        -    Send a message to another network user.
  557.     N_MsgMode()        -    Return current station broadcast mode.
  558.     N_MsgRtrv()        -    Retrieve a stored message from the file server.
  559.     N_Snd2Serv()    -    Broadcast message to server console.
  560.     N_SndFServ()    -    Broadcast message from server console.
  561.  
  562. ───────────────────────────────────
  563.  
  564. See Also:    N_MsgBrd(), N_MsgMode(), N_MsgRtrv(), N_Snd2Serv(), N_SndFServ()
  565.  
  566. ───────────────────────────────────
  567.  
  568. Miscellaneous Functions
  569.  
  570.     AboutGPLIB()    -    Return version information for GPLIB
  571.     AMPM()            -    Function to return time as character string with AM or PM appended.
  572.     ColdBoot()        -    Coldboot a computer.
  573.     CtlAltShft()    -    Return true if Control, Alt, or Shift key is held down
  574.     ElapseTime()    -    Function to return difference in minutes between two time strings.
  575.     FileCount()        -    Function to return # of matching files in a directory.
  576.     FindFirst()        -    Function to perform a DOS find first/find next.
  577.     Flag()            -    Set DOS file attributes.
  578.     GenError()        -    Function to generate a FoxPro error.
  579.     IsDiskIn()        -    Function to return whether a disk is in the floppy drive specified.
  580.     Make_Dir()        -    Create directory.
  581.     Math_Chip()        -    Return true if a 80x87 math coprocessor is installed.
  582.     MReset()        -    Perform mouse reset & return number of buttons.
  583.     N_DrvList()        -    Return list of available drives.    
  584.     Num_Serial()    -    Return Number of Serial Ports
  585.     Rem_Dir()        -    Remove a directory
  586.     SetMLimit()        -    Set Mouse Limits
  587.     SetMPos()        -    Set Mouse Cursor Position
  588.     ShftPrtScr()    -    Invoke Hardware Interrupt 5 (Shift-Printscreen)
  589.     TrimLen()        -    Return Trimmed Length of a String
  590.  
  591. ───────────────────────────────────
  592.  
  593. See Also:    AMPM(), AboutGPLIB(), ColdBoot(), CtlAltShft(), ElapseTime(), FileCount(), FindFirst(), Flag(), GenError(), IsDiskIn(), MReset(), Make_Dir(), Math_Chip(), Num_Serial(), Rem_Dir(), SetMLimit(), SetMPos(), ShftPrtScr(), TrimLen()
  594.  
  595. ───────────────────────────────────
  596.  
  597. Printer Functions
  598.  
  599.     N_CapMode(),    -    Toggle capture on or off.
  600.     N_DelQJob()        -    Function to remove a print job from a queue.
  601.     N_FlushLPT()    -    Flush capture of specified LPT port.
  602.     N_GetQList()    -    Return List of Queues from server.
  603.     N_LstQJobs()    -    Function to create an array containing print jobs for the specified queue.
  604.     N_MoveQJob()    -    Function to move print job within a print queue.
  605.     N_RdPParms()    -    Get current Capture Settings
  606.     N_StPParms()    -    Modify Current capture settings.
  607.     N_UserBnnr()    -    Read/Set User Banner Name
  608.     
  609. ───────────────────────────────────
  610.  
  611. See Also:    N_CapMode(), N_DelQJob(), N_FlushLPT(), N_GetQList(), N_LstQJobs(), N_MoveQJob(), N_RdPParms(), N_StPParms(), N_UserBnnr()
  612.  
  613. ───────────────────────────────────
  614.  
  615. Server Functions
  616.  
  617.     N_ConsOper()    -    Return whether user is a console operator
  618.     N_DirInfo()        -    Return directory owner and rights mask.
  619.     N_FileInfo()    -    Return information about files.
  620.     N_GetSList()    -    Return List of Servers from the file server.
  621.     N_LIStat()        -    Read/Set the login state of the server
  622.     N_MaxConns()    -    Return Maximum NetWare connections.
  623.     N_SerialNo()    -    Return server NetWare serial number.
  624.     N_ServDate()    -    Return File Server Date
  625.     N_ServTime()    -    Return File Server Time
  626.     N_ServVers()    -    Return NetWare version number.
  627.     N_SetAttr()        -    Set extended attributes on a NetWare file.    
  628.     N_Volumes()        -    Create array of mounted volumes.
  629.  
  630. ───────────────────────────────────
  631.  
  632. See Also:    N_ConsOper(), N_DirInfo(), N_FileInfo(), N_GetSList(), N_LIStat(), N_MaxConns(), N_SerialNo(), N_ServDate(), N_ServTime(), N_ServVers(), N_SetAttr(), N_Volumes()
  633.  
  634. ───────────────────────────────────
  635.  
  636. Station Functions
  637.  
  638.     N_Attached()    -    Return whether attached to a server.
  639.     N_ClearSta()    -    Clear Specified Connection Number
  640.     N_ConnNum()        -    Return NetWare station number.
  641.     N_CUsing()        -    Return a list of stations using a specified file.
  642.     N_DefServr()    -    Change default server.
  643.     N_DriveCnt()    -    Return number of logical local drives.
  644.     N_DrvDepth()    -    Return relative drive depth for "fake root" drives.    
  645.     N_DrvPath()        -    Return Path for a drive letter.
  646.     N_GetLocks()    -    Return list of file/record locks for a file.
  647.     N_LoggedIn()    -    Return whether specified user is logged into the network.
  648.     N_Login()        -    Login to a file server.
  649.     N_LogInfo()        -    Return Login date or time for a station.
  650.     N_LogOff()        -    Logout of specified file server.
  651.     N_LongMach()    -    Get Long Machine Type
  652.     N_MapDel()        -    Delete A drive mapping
  653.     N_MapDrive()    -    Map a drive
  654.     N_MapRoot()        -    Map root command.
  655.     N_ServAtch()    -    Attach to a file server.
  656.     N_ServDtch()    -    Detach from file server
  657.     N_Servers()        -    Create list of servers currently logged into.    
  658.     N_ServFrDr()    -    Return file server name for a mapped drive
  659.     N_SetDots()        -    Set SHOW DOTS on or off, or return current value.
  660.     N_ShellVer()    -    Return Shell Version
  661.     N_ShrtMach()    -    Get Short Machine Type
  662.     N_StaAddr()        -    Return Physical station Address
  663.     N_SYSTime()        -    Synchronize stations clock to server.
  664.     N_UserID()        -    Return NetWare User ID
  665.     UniqueName()    -    Return unique file name
  666.  
  667. ───────────────────────────────────
  668.  
  669. See Also:    N_Attached(), N_ClearSta(), N_ConnNum(), N_CUsing(), N_DefServr(), N_DriveCnt(), N_DrvDepth(), N_DrvPath(), N_LogInfo(), N_LogOff(), N_LoggedIn(), N_Login(), N_LongMach(), N_MapDel(), N_MapDrive(), N_MapRoot(), N_ServAtch(), N_ServDtch(), N_Servers(), N_ServFrDr(), N_SetDots(), N_ShellVer(), N_ShrtMach(), N_StaAddr(), N_SYSTime(), N_UserID(), UniqueName()
  670.  
  671. ───────────────────────────────────
  672.  
  673. TTS/Semaphore Functions
  674.  
  675.     N_SetSem()        -    Perform NetWare semaphore locking.
  676.     N_TTSAvail()    -    Return / Set TTS Availability
  677.     N_TTSBegin()    -    Begin a TTS Transaction
  678.     N_TTSCommt()    -    End a TTS Transaction
  679.     N_TTSStat()        -    Return status of a completed transaction
  680.     N_TTSRollB()    -    Rollback a TTS Transaction
  681.  
  682. ───────────────────────────────────
  683.  
  684. See Also:    N_SetSem(), N_TTSAvail(), N_TTSBegin(), N_TTSCommt(), N_TTSRollB(), N_TTSStat()
  685.  
  686. ───────────────────────────────────
  687.  
  688.  
  689. Additional Sample Procs.
  690.  
  691.     GPLIB is accompanied by many additional programs that demonstrate how GPLIB can be used.  Below is a short description of each program.
  692.  
  693.     DosToNet.PRG    A simple function to convert a DOS file spec to the equivalent NetWare Volume:<Path>\<FileSpec> format.
  694.  
  695.     QMgr.PRG        A simple queue manager program demonstrating how to use N_LstQJobs(), N_MoveQJob() and N_DelQJob().
  696.  
  697.     SetPJob.PRG        This program demonstrates how to read the Novell PrintCon job database, and use the information in it to setup capture parameters.
  698.  
  699.     SetQueue.SCX    This screen implements a simple queue selection.
  700.  
  701.     GPDEMO.PJX        This project contains several routines that demonstrate how to use various GPLIB functions.  To execute this demo, execute the following commands from the FoxPro command window:
  702.  
  703.         BUILD APP GPDEMO FROM GPDEMO
  704.         DO GPDEMO
  705.  
  706. ____________________________________________________________________________
  707. AboutGPLIB() - Return version information for GPLIB
  708.  
  709. Description
  710.  
  711.     This function displays the current version number of GPLIB, and the compile date in a WAIT WINDOW.  If the version of GPLIB is registered, a second WAIT WINDOW will appear showing the registered owner's name and your GPLIB serial number.
  712.  
  713. Usage
  714.  
  715.     AboutGPLIB( [NoDisplay] )
  716.  
  717.         If the optional parameter of NoDisplay is passed, then the wait window will not be shown.
  718.  
  719. Return Values
  720.  
  721.     GPLIB version number.
  722.  
  723. ╓─────────────────────────────────╖
  724. ║             Examples            ║
  725. ╙─────────────────────────────────╜
  726.  
  727.     ?AboutGPLIB()
  728.         2.55
  729.  
  730. ____________________________________________________________________________
  731. AMPM() - Return time string with AM or PM appended.
  732.  
  733. Description
  734.  
  735.     Return time string in standard form with AM or PM appended.
  736.  
  737. Usage
  738.  
  739.     AMPM([ nSeconds ] )
  740.  
  741.     nSeconds is the optional number of seconds after midnight.  If this value is not passed, the function returns the current time.  If you pass a seconds value, then that time in seconds past midnight is converted to a standard AM/PM time string.
  742.  
  743. Return Values
  744.  
  745.     Time string with AM or PM appended.
  746.  
  747. ╓─────────────────────────────────╖
  748. ║             Examples            ║
  749. ╙─────────────────────────────────╜
  750.  
  751.     ?AMPM()
  752.         1:47 PM
  753.  
  754.     ?'The report must be filled out and returned to this office by '
  755.     ??AMPM(Seconds()+3*60*60)  &&    Current time in seconds + 3 hours * 60 minutes * 60 seconds to yield a time three hours from the current time.
  756.  
  757. ───────────────────────────────────
  758.  
  759. See Also:    ElapseTime()
  760.  
  761. ───────────────────────────────────
  762.  
  763. ____________________________________________________________________________
  764. ColdBoot() -  Cold Boot a computer.
  765.  
  766. Description
  767.  
  768.     Perform a hard reset of a computer.
  769.  
  770. Usage
  771.  
  772.     ColdBoot()
  773.  
  774. Return Values
  775.  
  776.     N/A
  777.  
  778. Comments
  779.  
  780.     This function is only available for FoxPro for DOS.  Calls to this function from FoxPro for Windows will be ignored.
  781.  
  782. WARNING
  783.  
  784.     YOU AS A DEVELOPER TAKE FULL RESPONSIBILITY FOR THE CONSEQUENCES OF THIS FUNCTION.  COLD-BOOTING PCs WITH CERTAIN CACHE AND COMPRESSION SOFTWARE ACTIVE MAY CAUSE THE HARD DRIVE PARTITION ON THAT COMPUTER TO BE UNREADABLE.
  785.  
  786. ╓─────────────────────────────────╖
  787. ║             Examples            ║
  788. ╙─────────────────────────────────╜
  789.  
  790.     ?"In order for changes made to your computer's configuration"
  791.     ?"to take effect, it is necessary to reboot your computer."
  792.     ?
  793.     ?"Press any key to reboot your computer."
  794.     clear typeahead
  795.     =inkey(0,"HM")
  796.     ?ColdBoot()
  797.  
  798. ____________________________________________________________________________
  799. CtlAltShft() - Return true if control, alt, or shift key is held down
  800.  
  801. Description
  802.  
  803.     Return state of control, alt and shift keys.
  804.  
  805. Usage
  806.  
  807.     ? CtlAltShft()
  808.  
  809. Return Values
  810.  
  811.     True if the Control, Alt or Shift key is held down, .f. otherwise.
  812. ╓─────────────────────────────────╖
  813. ║             Examples            ║
  814. ╙─────────────────────────────────╜
  815.  
  816.     * This example shows how you could use CtlAltShft in a program to hide the window when the user presses one of those keys.
  817.  
  818.     define window Disp_msg from 10,10 to 20,70 double float
  819.     activate window disp_msg
  820.     ?' This is a message '
  821.     do while lastkey()<>27
  822.         =inkey(.5,'H')
  823.         If CtlAltShft()
  824.             hide window disp_msg
  825.             do while CtlAltShft()
  826.             *  nothing
  827.             enddo
  828.             Show Window disp_msg
  829.         Endif
  830.     enddo
  831.  
  832. ____________________________________________________________________________
  833. ElapseTime() - Return the difference in minutes between two time strings.
  834.  
  835. Description
  836.  
  837.     Return the difference in minutes between two time strings.
  838.  
  839. Usage
  840.  
  841.     ElapseTime( cTimeStart, cTimeStop )
  842.  
  843.     cTimeStart and cTimeStop are character strings that contain the start time and the stop time.  The character strings must be in the standard format for time strings.  I.E. '21:30:34'.
  844.  
  845. Return Values
  846.  
  847.     Number corresponding to the difference between the two times.
  848.  
  849. Comments
  850.  
  851.     Input resolution is only supported to the second.  If cTimeStart is less than cTimeStop, it is assumed that midnight has passed.
  852.  
  853. ╓─────────────────────────────────╖
  854. ║             Examples            ║
  855. ╙─────────────────────────────────╜
  856.  
  857.     && Capture information about the start & end of event.
  858.     Replace TimeStart with Time()
  859.     && Event
  860.     Replace TimeEnd with Time()
  861.     *  Show those cases that took longer than 15 minutes.
  862.     List for ElapseTime(TimeStart, TimeEnd) > 15
  863.  
  864.     *  Example 2
  865.     ?elapsetime('21:00:00','21:01:30')
  866.         1.500
  867.  
  868.     *  Example 3
  869.  
  870.     ?elapsetime('21:00:00','20:00:00')  && 23*60
  871.         1380.000
  872.  
  873. ───────────────────────────────────
  874.  
  875. See Also:    AMPM()
  876.  
  877. ───────────────────────────────────
  878.  
  879. ____________________________________________________________________________
  880. FileCount() - Return # of matching files in a directory.
  881.  
  882. Description
  883.  
  884.     Return the number of files matching a passed file specification.
  885.  
  886. Usage
  887.  
  888.     FileCount( cFileSpec )
  889.  
  890.         cFileSpec is the file specification to obtain the count for
  891.  
  892. ╓─────────────────────────────────╖
  893. ║             Examples            ║
  894. ╙─────────────────────────────────╜
  895.  
  896.     ?FileCount('*.bak')  && Get number of .bak files.
  897.         36
  898. ───────────────────────────────────
  899.  
  900. See Also:    Flag()
  901.  
  902. ───────────────────────────────────
  903.  
  904. ____________________________________________________________________________
  905. FindFirst() - Function to perform a DOS find-first /find-next
  906.  
  907. Description
  908.  
  909.     Perform a DOS find first / find next, and return file information.
  910.  
  911.  
  912. Usage
  913.  
  914.     FindFirst( cFileSpec | 1 [, cAttribs ] )
  915.  
  916.         cFileSpec is the file specification to search for.  You must start your series of calls with a character FileSpec.  Subsequent calls (FindNext) are signalled by passing a 1 as the first parameter.
  917.  
  918.         cAttribs is an optional attribute specifier that allows Directory and volume names to be searched for as well.  Valid values are 'D', and 'V'
  919.  
  920. Return Values
  921.  
  922.     If the command was successful it returns a string in the format:
  923.  
  924.         FILENAME.EXT,FILE_SIZE,FILE_DATE,FILE_TIME,FILE_ATTRIBUTES
  925.  
  926.     otherwise, it returns a null string ("").
  927.  
  928. Comments
  929.  
  930.     This command is intended to be a replacement for the SYS(2000) command.  Computers running the standard version of FoxPro cannot use the ADIR() function when there are more than 720 files present.  Using ADIR() on individual files is unacceptably slow.  This function allows you to overcome these limitations.
  931.  
  932.     If you specify 'D' as the second parameter to include, all normal files, archive files, and read-only files are returned as well as directories.  This is a function of MSDOS.  If you specify 'V', only the volume name is returned.
  933.  
  934.  
  935. ╓─────────────────────────────────╖
  936. ║             Examples            ║
  937. ╙─────────────────────────────────╜
  938.  
  939. *  This program builds a cursor containing files in the current
  940. *  directory, then performs a browse.
  941.  
  942. set library to gplib
  943. private FName, StartTime
  944. create cursor DirList (FileName c(12), Bytes n(9), date d(8), time c(8), Attribs c(5))
  945. FName=findfirst('*.*','D')
  946. StartTime=seconds()
  947. do while len(FName)>0
  948.     append blank
  949.     replace FileName with left(FName,at(',',FName)-1),;
  950.         bytes with val(substr(FName,at(',',FName)+1,at(',',FName,2))),;
  951.         date with ctod(substr(FName,at(',',FName,2)+1,at(',',FName,3))),;
  952.         time with substr(FName,at(',',FName,3)+1,at(',',FName,4) ),;
  953.         Attribs with substr(FName,at(',',FName,4)+1)
  954.     if (reccount()%50)=0
  955.         wait window ltrim(str(reccount()))+' files...' nowait
  956.     endif
  957.     FName=findfirst(1)
  958. enddo
  959. index on FileName tag FileName
  960. wait window ltrim(str(reccount()))+' files found in '+;
  961.     ltrim(str(seconds()-StartTime,4,1))+' seconds.' ;
  962.     timeout 1
  963. browse
  964. close data
  965.  
  966. ───────────────────────────────────
  967.  
  968. See Also:    Flag(), Make_Dir(), Rem_Dir()
  969.  
  970. ───────────────────────────────────
  971.  
  972. ____________________________________________________________________________
  973. Flag() - Set DOS file attributes.
  974.  
  975. Description
  976.  
  977.     Set the DOS file attribute for a file or files.
  978.  
  979. Usage
  980.  
  981.     Flag( cFileSpec, cAttributesFlags )
  982.  
  983.     cFileSpec is the name of the file to change.  Standard DOS wildcards of '?' and '*' are supported.
  984.  
  985.     cAttributeFlags is the attributes to change.  Supported attribute flags are:
  986.  
  987.         R - Read Only
  988.         H - Hidden
  989.         S - System
  990.         A - Archive
  991.  
  992.     flags are in the format +<attribute>, to set that attribute bit, or -<attribute> to clear that attribute bit.  Spaces are not permitted between the bit operator, and bit name.
  993.  
  994. ╓─────────────────────────────────╖
  995. ║             Examples            ║
  996. ╙─────────────────────────────────╜
  997.  
  998.     =Flag('*.PRG','+R')  && Set all prg files in current directory read-only
  999.  
  1000. ───────────────────────────────────
  1001.  
  1002. See Also:    FileCount()
  1003.  
  1004. ───────────────────────────────────
  1005.  
  1006. ____________________________________________________________________________
  1007. GenError() - Generate a FoxPro Error
  1008.  
  1009. Description
  1010.  
  1011.     Generate a FoxPro error.  This error will be handled by whatever the current ON ERROR handler is.  When the function is called, the FoxPro ERROR() function returns 1098 (User defined error), and the message specified is returned by MESSAGE()
  1012.  
  1013. Usage
  1014.  
  1015.     GenError( cCustomMessage )
  1016.  
  1017.     cCustomMessage is the character string that the MESSAGE() function returns when the error is generated.  The length of the message may be up to 80 characters.
  1018.  
  1019. Comments
  1020.  
  1021.     I use ProError by Pat Adams extensively in my programs, and I have had times when I wished to generate an error so that the information would be captured by ProError.  An example of such a case is shown below.  Some other areas might be when a password is incorrectly entered, you could log the error into the ProError database for later examination.
  1022.  
  1023. ╓─────────────────────────────────╖
  1024. ║             Examples            ║
  1025. ╙─────────────────────────────────╜
  1026.  
  1027.     Private File_Handle
  1028.     File_Handle=FOPEN('INPUT.DAT')
  1029.     if File_Handle < 0
  1030.         =GenError('Error opening file INPUT.DAT')
  1031.     else
  1032.         *  Process the file
  1033.     endif
  1034.  
  1035. ____________________________________________________________________________
  1036. IsDiskIn() - Return whether disk is in the specified floppy drive.
  1037.  
  1038. Description
  1039.  
  1040.     Return whether disk is in the specified floppy drive.
  1041.  
  1042. Usage
  1043.  
  1044.     IsDiskIn( cDriveLetter )
  1045.  
  1046.         cDriveLetter is the drive to check (e.g. 'A')
  1047.  
  1048.  
  1049. Return Values
  1050.  
  1051.     .T. if diskette is inserted in specified drive.  .F. if not inserted.  Note the diskette inserted in the drive must be formatted for this function to return .T.  If a fixed disk is specified, the function will return .T.
  1052.  
  1053. ╓─────────────────────────────────╖
  1054. ║             Examples            ║
  1055. ╙─────────────────────────────────╜
  1056.  
  1057.     If IsDiskIn('A')
  1058.         Wait Window 'Purging last months data to floppy disk.' nowait
  1059.         fname='A:'+left(cmonth(date()),6)+alltrim(str( year(date()) % 100 ))
  1060.         copy to (fname) for status='CLOSED'
  1061.         delete for status='CLOSED'
  1062.         pack
  1063.     else
  1064.         wait window 'Purge process aborted.'
  1065.     endif
  1066.  
  1067. ____________________________________________________________________________
  1068. Make_Dir() - Create directory.
  1069.  
  1070. Description
  1071.  
  1072.     The purpose of this routine is to create a DOS directory.
  1073.  
  1074. Usage
  1075.  
  1076.     MAKE_DIR( cDirName )
  1077.  
  1078.     cDirName is the name of the directory to create
  1079.  
  1080. Return Values
  1081.  
  1082.     .T. if successful, .F. otherwise
  1083.  
  1084. ╓─────────────────────────────────╖
  1085. ║             Examples            ║
  1086. ╙─────────────────────────────────╜
  1087.  
  1088.     if .not. make_dir('C:\MyProg\Temp')
  1089.         ?'Unable to create directory'
  1090.     else
  1091.         ?'Directory created'
  1092.     endif
  1093.  
  1094. Comments
  1095.  
  1096.     This routine will only create 1 directory level.  I.E. in order to create C:\TEMP\TEMP1, the directory C:\TEMP must exist before the TEMP1 directory can be created.  One thing that can cause this routine to fail is the presence of a file with the same name as the directory you are trying to create.  I.E. if file TEMP exists, creating a directory name TEMP will fail.  This is because they are both directory entries on this disk, with only the attribute bit specifying one is a directory.
  1097.  
  1098. ───────────────────────────────────
  1099.  
  1100. See Also:    Rem_Dir()
  1101.  
  1102. ───────────────────────────────────
  1103.  
  1104. ____________________________________________________________________________
  1105. Math_Chip() - Return true if a 80x87 math coprocessor is installed.
  1106.  
  1107. Description
  1108.  
  1109.     Return .T. if a math coprocessor is installed in the executing machine.
  1110.  
  1111. Usage
  1112.  
  1113.     Math_Chip()
  1114.  
  1115. Return Values
  1116.  
  1117.     .T. if math coprocessor installed, .F. if math coprocessor not installed.
  1118.  
  1119. Comments
  1120.  
  1121.     This function reads the BIOS equipment list to get the result.
  1122.  
  1123. ───────────────────────────────────
  1124.  
  1125. See Also:    Num_Serial()
  1126.  
  1127. ───────────────────────────────────
  1128.  
  1129. ____________________________________________________________________________
  1130. MReset() - Perform mouse reset.
  1131.  
  1132. Description
  1133.  
  1134.     Reset the mouse
  1135.  
  1136. Usage
  1137.  
  1138.     MRESET()
  1139.  
  1140. Return Values
  1141.  
  1142.     FoxPro for DOS
  1143.  
  1144.         0 if mouse driver is not installed, otherwise it returns the number of mouse buttons.
  1145.  
  1146.     FoxPro for Windows
  1147.  
  1148.         2 always.
  1149.  
  1150. ───────────────────────────────────
  1151.  
  1152. See Also:    SetMLimit(), SetMPos()
  1153.  
  1154. ───────────────────────────────────
  1155.  
  1156. ____________________________________________________________________________
  1157. N_AccsDate() - Return date or time user last accessed the network.
  1158.  
  1159. Description
  1160.  
  1161.     Return the date or time the specified user last accessed the network.
  1162.  
  1163. Usage
  1164.  
  1165.     N_AccsDate( cUserID ,  1 || 2 )
  1166.  
  1167.     cUserID user ID to get the last network access time for.
  1168.  
  1169.     If the second parameter is 1, the last login date will be returned as a variable of type date.
  1170.  
  1171.     If the second parameter is 2, the last login time will be returned in seconds past midnight.
  1172.  
  1173. Return Values
  1174.  
  1175.     Last network access date, or time depending on the second paramter.
  1176.  
  1177. Comments
  1178.  
  1179.     To use this routine to get the last login date for any person besides the person operating the program, you must be a supervisor equivalent, equivalent to that user, or manager over that user.
  1180.  
  1181. ╓─────────────────────────────────╖
  1182. ║             Examples            ║
  1183. ╙─────────────────────────────────╜
  1184.  
  1185.     ?N_AccsDate(N_UserID(), 1)
  1186.         02/27/92
  1187.  
  1188.     ?N_AccsDate(N_UserID(), 2)
  1189.         9345
  1190.  
  1191.     *  This example demonstrates a house cleaning routine that will put
  1192.     *  an entry in the system error log when accounts are inactive.
  1193.     *  You must be a supervisor or equivalent for this program to work.
  1194.     =N_AcctList("UserArray")
  1195.     create cursor Users (UserID C(48), MailID C(8), LastDate D(8))
  1196.     append from array UserArray
  1197.     replace all LastDate with N_AccsDate(UserID,1)
  1198.     index on LastDate Tag LastDate
  1199.     set printer to f:\system\sys$log.err additive
  1200.     set print on
  1201.     ?
  1202.     ? Padc(" Inactive Account Warnings ",78,'*')
  1203.     ?
  1204.     scan for LastDate < (date() - 180)
  1205.         ? rtrim(UserId)+", "+N_UserName(alltrim(userid))
  1206.         if LastDate={}
  1207.             ??", has never logged in."
  1208.         else
  1209.             ??", has not logged in since "+dtoc(lastDate)+"."
  1210.         endif
  1211.     endscan
  1212.     ?
  1213.     ? replicate("*",78)
  1214.     set print off
  1215.     set printer to
  1216.  
  1217. ───────────────────────────────────
  1218.  
  1219. See Also:  N_PwdDate()
  1220.  
  1221. ───────────────────────────────────
  1222.  
  1223. ____________________________________________________________________________
  1224. N_AcctList() - Return list of user accounts from the server.
  1225.  
  1226. Description
  1227.  
  1228.     Create an array containing all user accounts on the default server.
  1229.  
  1230. Usage
  1231.  
  1232.     N_AcctList( cArrayName[, cAcctSpec, cServerName, .T.  ])
  1233.  
  1234.     cArrayName is the name of the array that will be created to hold the information returned.
  1235.  
  1236.     cAcctSpec is an option specifier that limits the names of the accounts returned.
  1237.  
  1238.     cServerName is an optional server identifier.  You can specify a different server to get the account list from (besides the default server).
  1239.  
  1240.     If a .T. is passed as the fourth parameter, the array created will be public.
  1241.  
  1242.  
  1243. Return Values
  1244.  
  1245.     The number of user accounts on the server, and a two dimensional array where column 1 is the Login ID's, and column 2 is the NetWare Object ID assigned to that user.
  1246.  
  1247. Comments
  1248.  
  1249.     The NetWare ObjectID is the same as the users mail ID.
  1250.  
  1251. ╓─────────────────────────────────╖
  1252. ║             Examples            ║
  1253. ╙─────────────────────────────────╜
  1254.  
  1255.     *  The following example builds an array of all users on the
  1256.     *  server, and performs a browse of them.
  1257.  
  1258.     Set library to gplib
  1259.     =N_AcctList('UserArr')
  1260.     create cursor USERS (UserName C(48), User_OB_ID C(8))
  1261.     append from Array UserArr
  1262.     browse
  1263.  
  1264.     *
  1265.     * The second example finds a users mail directory
  1266.  
  1267.     =N_AcctList('Dummy',N_UserID())
  1268.     path='F:\MAIL\'+dummy[1,2]
  1269.     ?path
  1270.  
  1271.     *
  1272.     *  This example demonstrates getting a list of users from a different
  1273.     *  server.  Note use of '*' as cAcctSpec
  1274.     Set library to gplib
  1275.     =N_AcctList('UserArr','*','Engineering')
  1276.     create cursor USERS (UserName C(48), User_OB_ID C(8))
  1277.     append from Array UserArr
  1278.     browse
  1279.  
  1280.  
  1281. ───────────────────────────────────
  1282.  
  1283. See Also:    N_GetGroup(), N_GetQList(), N_GetWild()
  1284.  
  1285. ───────────────────────────────────
  1286.  
  1287. ____________________________________________________________________________
  1288. N_Attached() - Return whether workstation is attached to a file server.
  1289.  
  1290. Description
  1291.  
  1292.     Return whether a workstation is attached to the specified file server.
  1293.  
  1294. Usage
  1295.  
  1296.     N_Attached( cServerName )
  1297.  
  1298.         cServerName is the server name to check.
  1299.  
  1300. Return Values
  1301.  
  1302.     .T. if attached, .F. otherwise.
  1303.  
  1304. ───────────────────────────────────
  1305.  
  1306. See Also:    N_ServAtch(), N_ServDtch()
  1307.  
  1308. ───────────────────────────────────
  1309.  
  1310. ____________________________________________________________________________
  1311. N_CapMode() - Read/Set current capture state
  1312.  
  1313. Description
  1314.  
  1315.     Toggle the current capture state ON or OFF, or return the current capture state.
  1316.  
  1317. Usage
  1318.  
  1319.     N_CapMode( iLptPort [, lState , lDiscardJob ])
  1320.  
  1321.         iLptPort is the LPT port to set the capture state, or get the capture state for.
  1322.  
  1323.         lState is the flag used to set the capture state.  Allowed values are .T. or .F.
  1324.  
  1325.         lDiscardJob is an optional flag used in conjunction with lState.  If lState is .F. and lDiscardJob is true, then capture will be ended, and the current printjob discarded.  If lState is .F. and lDiscardJob is not passed, or is .F. then the job will be serviced normally.
  1326.  
  1327. Return Values
  1328.  
  1329.     If called in interrogate mode ( lState not passed ), the function returns .T. if capture is active, and .F. if capture is not active.  In set mode (lState is specified) the function returns .T. if successful, .F. if not successful.
  1330.  
  1331. ╓─────────────────────────────────╖
  1332. ║             Examples            ║
  1333. ╙─────────────────────────────────╜
  1334.  
  1335.     external array P_Array
  1336.     =N_RdPParms(1,'P_Array')
  1337.     P_Array[2]='MYQUEUE'
  1338.     =N_StPParms(1,'P_Array')
  1339.     *  Perform output & reports
  1340.     *  and then
  1341.     *  Send output to local printer
  1342.     =N_CapMode(1,.F.)
  1343.     *  Turn the net printer back on
  1344.     =N_CapMode(1,.T.)
  1345.  
  1346.  
  1347.     !capture nb nt q=printq_0
  1348.     ?N_CapMode(1)
  1349.         .T.
  1350.  
  1351. ───────────────────────────────────
  1352.  
  1353. See Also:    N_FlushLpt(), N_RdPParms(), N_StPParms()
  1354.  
  1355. ───────────────────────────────────
  1356.  
  1357. ____________________________________________________________________________
  1358. N_ChgPwd() - Change Bindery Object Password
  1359.  
  1360. Description
  1361.  
  1362.     The purpose of this function is to change a bindery object password.  The bindery object may be a user, print server, job server, etc.
  1363.  
  1364. Usage
  1365.  
  1366.     N_ChgPwd( cObjectID, cOldPassword, cNewPassword [, nObjectType] )
  1367.  
  1368.         cObjectID is the name of the object to change the password for.
  1369.  
  1370.         cOldPassword is the current password for the object.  If the person using this routine is a supervisor equivalent, then a null string may be passed.  This allows you to change the passwords for all users programatically.
  1371.  
  1372.         cNewPassword is the new password for the object.
  1373.  
  1374.         nObjectType is the type of object to change the password for.  If this optional parameter is not passed, the default object type is 1 (user).  Some object types are:
  1375.  
  1376.             User            1
  1377.             Job Server        5
  1378.             Print Server    7
  1379.             Archive Server    9
  1380.  
  1381. Return Values
  1382.  
  1383.         0        Success
  1384.         215        Password Not Unique
  1385.         216        Password too short
  1386.         248        No Property Write Privilege
  1387.         255        No Such Object Or Bad Password
  1388.  
  1389. Comments
  1390.  
  1391.     This function does no validation to ensure that a password is valid.  It is recommended that you use the sample validation routine provided.
  1392.  
  1393. ╓─────────────────────────────────╖
  1394. ║             Examples            ║
  1395. ╙─────────────────────────────────╜
  1396.  
  1397. *
  1398. *    Change the current users password
  1399. *
  1400.  
  1401. store space(127) to cOldPass, cNewPass
  1402. clear
  1403. @5,5 Say 'Enter Old Password : ' Get cOldPass Picture '@S40'
  1404. @7,5 Say 'Enter New Password : ' Get cNewPass Picture '@S40'
  1405. read
  1406. if GoodPass(cOldPass) and GoodPass(cNewPass)
  1407.     nResult=N_ChgPwd(N_UserID(), cOldPass, cNewPass)
  1408.     if nResult != 0
  1409.         wait window 'Password Change Failed!'
  1410.     else
  1411.         Wait window 'Password Change successful!'
  1412.     endif
  1413. endif
  1414.  
  1415. Function GoodPass
  1416. *
  1417. * Description:
  1418. *
  1419. *    Provide a simple password validation routine
  1420. Parameter cPassWord
  1421. private n, c, lOk
  1422. lOk=not empty(cPassword)
  1423. cPassWord=upper(alltrim(cPassword))
  1424. for n=1 to len(cPassword)
  1425.     c=substr(cPassword,n,1)
  1426.     lOk=lOk and (isalpha(c) or isdigit(c) or c=='_')
  1427. endfor
  1428. return lOk
  1429.  
  1430.  
  1431. ───────────────────────────────────
  1432.  
  1433. See Also:    N_GetWild(), N_PwdDate()
  1434.  
  1435. ───────────────────────────────────
  1436.  
  1437.  
  1438. ____________________________________________________________________________
  1439. N_ChkOwner() - Check/Set Ownership of Specified Files
  1440.  
  1441. Description
  1442.  
  1443.     The purpose of this function is to check/set the ownership of a specified file, or files.  
  1444. Usage
  1445.  
  1446.     N_ChkOwner( cFileSpec [, cUserName, lOverRide] )
  1447.  
  1448.         cFileSpec is the file specification to check ownership for.  It may contain the DOS wildcard characters * and ?.  cFileSpec must be in the form <Volume>:<Path>\FileSpec.Ext.
  1449.  
  1450.         cUserName is the optional new user to assign unowned files to.
  1451.  
  1452.         lOverRide is an override that allows you to assign all files matching cFileSpec to cUserName, regardless of whether the current owner is valid or not.  If lOverRide is .t., files will be changed regardless of whether they have a valid owner.  If .f., they will only be changed if the owner is invalid.
  1453.  
  1454. Return Values
  1455.  
  1456.     If only cFileSpec is passed, the function returns .T. if all files have a valid owner, and .F. if they do not.
  1457.  
  1458.     If cUserName is passed, then the function returns .t. if the change was made to the new owner, and .f. otherwise.
  1459.  
  1460. Comments
  1461.  
  1462.     Under NetWare, if the owner of a file is deleted and an attempt is made to increase the size of the file, the command will fail.  FoxPro will return an error INSUFFICIENT DISK SPACE.  The technical reason this fails is because on the call to increase the file size, NetWare makes a call to GetObjectDiskRestrictions().  The call to GetObjectDiskRestrictions fails because the user no longer exists.  NetWare treats the failure of this call as NO_DISKSPACE_REMAINING.  Using this function you can check for this conditition before it causes an error.
  1463.  
  1464.     This error will not necessarily come on the first call to append, but rather when the file size increases to the point where NetWare needs to allocate another block to the file.
  1465.  
  1466.     You must be a supervisor equivalent or have SUPERVISORY rights over the directory in which the file resides to use the owner re-assignment option.
  1467.  
  1468. ╓─────────────────────────────────╖
  1469. ║             Examples            ║
  1470. ╙─────────────────────────────────╜
  1471.  
  1472. if not N_ChkOwner('sys:foxdata\*.dbf') && Check to see if the files are ok
  1473.     *
  1474.     * we have some bad files, let's try to assign ownership
  1475.     * to the person currently executing the program
  1476.     *
  1477.     if not N_ChkOwner('sys:foxdata\*.dbf',N_UserID())
  1478.         =msgwin('Some files required by this program do not have a valid owner'+;
  1479.             ' please contact your network administrator and ask him to '+;
  1480.             'correct this problem.~~Program cancelled!')
  1481.         cancel
  1482.     endif
  1483. endif
  1484.  
  1485. ───────────────────────────────────
  1486.  
  1487. See Also:    N_UserID()
  1488.  
  1489. ───────────────────────────────────
  1490.  
  1491. ____________________________________________________________________________
  1492. N_ClearSta() - Clear Specified station
  1493.  
  1494. Description
  1495.  
  1496.     The purpose of this function is to clear the specified network station number.
  1497.  
  1498. Usage
  1499.  
  1500.     N_ClearSta( iStationNumber )
  1501.  
  1502.     iStationNumber is the station number to clear.
  1503.  
  1504. Comments
  1505.  
  1506.     You must be a supervisor equivalent to execute this command.
  1507.  
  1508. WARNING
  1509.  
  1510.     DO NOT CLEAR YOUR OWN STATION AS A TEST!  Under certain versions of NetWare, this can cause the server to not recognize your connection until the connection has been manually deleted at the server.  This can have the effect of making your network interface card appear defective.  If you have to manually delete your connection at the server and you are running NetWare 3.10, ensure that you have the latest version of monitor.nlm, otherwise clearing that connection may cause an ABEND on your server.
  1511.  
  1512. ╓─────────────────────────────────╖
  1513. ║             Examples            ║
  1514. ╙─────────────────────────────────╜
  1515.  
  1516.     *  Clear all users logged in as GUEST prior
  1517.     *  to packing DBF.  NOTE:  THE RESULTS OF CLEARING A CONNECTION WITH
  1518.     *  READ/WRITE PRIVELIGES TO AN OPEN DBF ARE UNDEFINED, AND YOU
  1519.     *  AS PROGRAMMER ACCEPT FULL RESPONSIBILITY FOR YOUR ACTIONS.
  1520.     *
  1521.     for loop= 1 to N_MaxConns()
  1522.         if N_UserID()=='GUEST'
  1523.             =N_ClearSta(Loop)
  1524.         endif
  1525.     endfor
  1526.  
  1527. ───────────────────────────────────
  1528.  
  1529. See Also:    N_ConnNum(), N_UserID()
  1530.  
  1531. ───────────────────────────────────
  1532.  
  1533. ____________________________________________________________________________
  1534. N_ConnNum() - Return NetWare station number.
  1535.  
  1536. Description
  1537.  
  1538.     Return the NetWare connection number for the current machine.  Each time a station logs into a NetWare file server, it is issued a connection number.  This number will vary from 1 to the number corresponding to your NetWare License limit.
  1539.  
  1540. Usage
  1541.  
  1542.     N_ConnNum()
  1543.  
  1544. Return Values
  1545.  
  1546.     The NetWare station number as an integer.
  1547.  
  1548. ╓─────────────────────────────────╖
  1549. ║             Examples            ║
  1550. ╙─────────────────────────────────╜
  1551.  
  1552.     ScratchFile='$T'+alltrim(str(N_ConnNum()))+'TEMP.FIL'
  1553.     copy structure to (ScratchFile)
  1554.     use (scratchFile) ALIAS Scratch
  1555.     *  Perform some kind of processing
  1556.     use
  1557.     erase (scratchFile)
  1558.  
  1559. ───────────────────────────────────
  1560.  
  1561. See Also:    N_StaAddr(), N_UserID(), UniqueName()
  1562.  
  1563. ───────────────────────────────────
  1564.  
  1565. ____________________________________________________________________________
  1566. N_ConsOper() - Return whether person is console operator.
  1567.  
  1568.  
  1569. Description
  1570.  
  1571.     Return whether the person on the executing workstation is a NetWare Console Operator.  A person must be a console operator before performing certain functions (enabling or disabling TTS, sending messages from the server console, etc.
  1572.  
  1573. Usage
  1574.  
  1575.     N_ConsOper()
  1576.  
  1577. Return Values
  1578.  
  1579.     .T. if person is a console operator, .F. otherwise.
  1580.  
  1581. ───────────────────────────────────
  1582.  
  1583. See Also:    N_LIStat()
  1584.  
  1585. ───────────────────────────────────
  1586.  
  1587. ____________________________________________________________________________
  1588. N_CUsing()    -    Return a list of stations using a specified file.
  1589.  
  1590. Description
  1591.  
  1592.     This function creates an array containg a list of stations/tasks using the specified file.
  1593.  
  1594. Usage
  1595.  
  1596.     N_CUsing( cArrayName, cFileName [, cServer, lPublic])
  1597.     
  1598.         cArrayName is the name of the array to create.
  1599.         
  1600.         cFileName is the name of the file to check.  cFileName must be in the format <VOLUME>:<PATH>\<NAME>.  I.E. SYS:PUBLIC\SYSCON.EXE.
  1601.         
  1602.         cServer is the optional server name where the file resides.
  1603.         
  1604.         lPublic is an optional parameter that governs whether the array is created PUBLIC or PRIVATE.  If .T. the array will be public.  If .F. or not passed, the array will be private.
  1605.     
  1606. Return Values
  1607.  
  1608.     The number of stations/tasks that have the specified file open.  The function creates a two-column array containing a list of stations/tasks that have the specified file open.  Column 1 is the station number, and column 2 is the task number.
  1609.  
  1610.     If an error occurs, the function returns the NetWare error code as a negative number.  Error codes are:
  1611.  
  1612.         -152    Volume Does Not Exist
  1613.         -156    Invalid File Name
  1614.         -198    Not A Console Operator
  1615.  
  1616.         
  1617. Comments
  1618.  
  1619.     The user on the executing workstation must be a NetWare Console Operator in order to call this function.  For more information on Console Operator status, please refer to your NetWare Concepts Manual.  One method of getting around the console operator requirement is to dedicate one program to receiving requests via shared DBF and passing results via shared DBF.
  1620.  
  1621.     With the advent of Microsoft Windows and other multi-tasking environments, more than one "task" on a work-station can have file open on one station.
  1622.  
  1623.     This function only works on NetWare 3.11 and higher.
  1624.     
  1625. ╓─────────────────────────────────╖
  1626. ║             Examples            ║
  1627. ╙─────────────────────────────────╜
  1628. private nResult, ok, n
  1629. ok=.f.
  1630. do while not ok
  1631.     nResult=N_CUsing('AUSERS',DosToNet('ACCOUNTS.DBF'))
  1632.     do case
  1633.     case nResult=0
  1634.         use accounts exclusive
  1635.         pack
  1636.         use
  1637.         ok=.t.
  1638.     case nResult<0
  1639.         Wait Window 'ERROR Calling N_CUsing().  Result Code :'+ltrim(str(nResult))
  1640.     otherwise
  1641.         for n=1 to alen(aUsers,1)
  1642.             =N_MsgBrd('PLEASE CLOSE ACCOUNTS DATABASE IMMEDIATELY!',N_UserID(aUsers[n,1]))
  1643.         endfor
  1644.         =inkey(60)
  1645.     endcase
  1646. enddo
  1647.  
  1648. ───────────────────────────────────
  1649.  
  1650. See Also:    N_ConsOper(), N_GetLocks()
  1651.  
  1652. ───────────────────────────────────
  1653.  
  1654. ____________________________________________________________________________
  1655. N_DefServr() - Read/Set the name of the default server
  1656.  
  1657. Description
  1658.  
  1659.     Read/Set the name of the default server
  1660.  
  1661. Usage
  1662.  
  1663.     N_DefServr( [cServerName] )
  1664.  
  1665.     If the optional parameter cServerName is not passed, the function returns the name of the current default server.  If cServerName is passed, then that server is made the new default server.
  1666.  
  1667. Return Values
  1668.  
  1669.     Name of the default server.
  1670.  
  1671. ╓─────────────────────────────────╖
  1672. ║             Examples            ║
  1673. ╙─────────────────────────────────╜
  1674.  
  1675. *  Display a list of users currently logged in, and their full names
  1676. *  on the engineering server.
  1677.  
  1678. =N_DefServr("ENGINEERING")
  1679. Max_Conns=N_MaxConns()
  1680. for loop=1 to Max_Conns
  1681.     if len(N_UserID(loop))>0
  1682.         ?str(loop,3), PADR(N_UserID(loop),12),padr(N_UserName(loop),40),N_LogInfo(loop,1), n_LogInfo(loop,2)
  1683.     endif
  1684. endfor
  1685.  
  1686. ───────────────────────────────────
  1687.  
  1688. See Also:    N_Servers()
  1689.  
  1690. ───────────────────────────────────
  1691.  
  1692.  
  1693. ____________________________________________________________________________
  1694. N_DelQJob() - Remove a print job from a queue
  1695.  
  1696. Description
  1697.  
  1698.     Remove a print job from a Novell Print Queue
  1699.  
  1700. Usage
  1701.  
  1702.     N_DelQJob( iJobNumber, cQueueName,  [, cServerName ] )
  1703.  
  1704.     iJobNumber is the NetWare Job Number.
  1705.  
  1706.     cQueueName is the print queue name.
  1707.  
  1708.     cServerName is the optional file server name where the queue resides.
  1709.  
  1710. Return Values
  1711.  
  1712.     NetWare completion code.
  1713.  
  1714.         0    -    Success
  1715.         208    -    Queue Error
  1716.         209    -    No Queue
  1717.         211    -    No Queue Rights
  1718.         213    -    No Queue Job
  1719.         214    -    No Job Rights
  1720.         254    -    Server Bindery Locked
  1721.         255    -    Bindery Failure
  1722.  
  1723. Comments
  1724.  
  1725.     Please refer to the Comments section for N_LstQJobs().
  1726.  
  1727. ╓─────────────────────────────────╖
  1728. ║             Examples            ║
  1729. ╙─────────────────────────────────╜
  1730.  
  1731.     ?N_DelQJob(272, 'PRINTQ_0')  && Remove job 272
  1732.  
  1733.     *  The following example demonstrates
  1734.     *  how to remove all jobs from a queue.
  1735.  
  1736.     JobCount=N_LstQJobs('PRINTQ_0','JobArray',)
  1737.     FOR Counter= 1 to JobCount
  1738.         =N_DelQJob(jobArray[counter,1],'PRINTQ_0')
  1739.     endfor
  1740.  
  1741.     For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.
  1742.  
  1743. ───────────────────────────────────
  1744.  
  1745. See Also:    N_GetQList(), N_LstQJobs(), N_MoveQJob()
  1746.  
  1747. ───────────────────────────────────
  1748.  
  1749. ____________________________________________________________________________
  1750. N_DirInfo() - Return directory information.
  1751.  
  1752. Description
  1753.  
  1754.     The purpose of this function is to return the directory owner, and effective rights mask for a specified directory.
  1755.  
  1756. Usage
  1757.  
  1758.     N_DirInfo( cDirName [, cServerName ])
  1759.  
  1760.         cDirName is the directory name in the format:
  1761.  
  1762.             VOLUME:DIRECTORY
  1763.  
  1764.         cServerName is the optional server name to retrieve the information from.
  1765.  
  1766. Return Values
  1767.  
  1768.     Character string containing the User ID of the directory owner, and the effective rights mask.
  1769.  
  1770. Comments
  1771.  
  1772.     Rights lists are returned in NetWare 386 format.  The Supervisory right flag is NOT returned.
  1773.  
  1774. ╓─────────────────────────────────╖
  1775. ║             Examples            ║
  1776. ╙─────────────────────────────────╜
  1777.  
  1778.     ?N_DirInfo('SYS:PUBLIC')
  1779.         SUPERVISOR,R    F
  1780.  
  1781. ____________________________________________________________________________
  1782. N_DriveCnt() - Return number of local drives
  1783.  
  1784. Description
  1785.  
  1786.     Return the number of drives that NetWare considers the local station to have.
  1787.  
  1788. Usage
  1789.  
  1790.     N_DriveCnt()
  1791.  
  1792. Return Values
  1793.  
  1794.     Number of local drives on the machine as an integer value.
  1795.  
  1796. ╓─────────────────────────────────╖
  1797. ║             Examples            ║
  1798. ╙─────────────────────────────────╜
  1799.  
  1800. ?'Your first NetWare drive letter is '+chr(65+N_DriveCnt())+':.'
  1801.  
  1802. *    This second example demonstrates how to find the first
  1803. *    drive letter mapped to SYS of the default server.
  1804.  
  1805. Function GetSYSLtr
  1806. *  The purpose of this function is to get the next available drive letter
  1807. Private Start
  1808. Start=chr(65+N_DriveCnt())
  1809. do while Start < '['
  1810.     if N_ServFrDr(start)=N_DefServr() .and. N_DrvPath(start)='SYS:'
  1811.         Exit
  1812.     else
  1813.         Start=Chr(ASC(Start)+1)
  1814.     endif
  1815. Enddo
  1816. if start='Z'
  1817.     wait window 'Unable to find drive mapped to SYS: on Def. Server'
  1818.     cancel
  1819. else
  1820.     Return Start
  1821. endif
  1822.  
  1823. ____________________________________________________________________________
  1824. N_DrvDepth() - Return relative drive depth.
  1825.  
  1826. Description
  1827.  
  1828.     This function returns the relative drive depth for a specified drive.  It can be used to determine if a drive was mapped using the MAP ROOT option.
  1829.  
  1830. Usage
  1831.  
  1832.     N_DrvDepth( cDrive )
  1833.     
  1834.         cDrive is the drive letter to check.
  1835.  
  1836. Return Values
  1837.  
  1838.     Relative drive depth for specified drive.  If drive is not mapped with the ROOT option, then this function returns 255.  If the specified drive is not mapped, the function returns 255.
  1839.  
  1840. ╓─────────────────────────────────╖
  1841. ║             Examples            ║
  1842. ╙─────────────────────────────────╜
  1843.  
  1844. =N_MapRoot('SYS:USERS','G')
  1845. ?N_DrvDepth('G')
  1846.     0
  1847.     
  1848. SET DEFA TO G:
  1849. SET DEFA TO (N_USERID())
  1850. ?N_DrvDepth('G')
  1851.     1
  1852.  
  1853. ?N_MapDrive('SYS:USERS','G')  && Note not a "fake root"
  1854. ?N_DrvDepth('G')
  1855.     255
  1856.  
  1857. ───────────────────────────────────
  1858.  
  1859. See Also:    N_DrvPath(), N_MapDel(), N_MapRoot(), N_ServFrDr()
  1860.  
  1861. ───────────────────────────────────
  1862.  
  1863. ____________________________________________________________________________
  1864. N_DrvList() - Return a list of available drives.
  1865.  
  1866. Description
  1867.  
  1868.     This function returns a list of available drives on the workstation.
  1869.  
  1870. Usage
  1871.  
  1872.     N_DrvList( cArrayName, [ iMask, lPublic ] )
  1873.  
  1874.  
  1875.         cArrayName is the name of the array to create.
  1876.         
  1877.         iMask is the optional drive mask to limit the types of drives returned.  If this parameter is not included, all drives are returned.  Allowed values are:
  1878.  
  1879.                 0        All Drives
  1880.                 1        Local Drives Only (Fixed and Removable)
  1881.                 2        Remote Drives Only (Fixed and Removable)
  1882.                 4        Removable Drives Only (Local and Remote)
  1883.                 5        Local Removable Drives Only
  1884.                 6        Remote Removable Drives Only
  1885.                 8        Fixed Drives Only (Local and Remote)
  1886.                 9        Local Fixed Drives Only
  1887.                 10        Remote Fixed Drives Only
  1888.         
  1889.  
  1890.         lPublic is an optional parameter that specifies if the array should be created as a public variable.  If .T., the array will be public, if .F. the array will be private.
  1891.  
  1892. Return Values
  1893.  
  1894.     The function returns the number of drives matching the desired drive-type.  The function creates a two-dimensional, three-column array containing information about the drives on the calling workstation.
  1895.  
  1896.         Column 1 is the drive letter 
  1897.     
  1898.         Column 2 is .T. if the drive is remote, .F. if local.
  1899.  
  1900.         Column 3 is .T. if the drive is removable, .F. if Fixed.
  1901.  
  1902. Comments
  1903.  
  1904.     This function uses standard DOS interrupt calls to make it's list.  Therefore, this function will work with any NOS (Banyan Vines, LanMan, NetWare, etc).
  1905.  
  1906. ╓─────────────────────────────────╖
  1907. ║             Examples            ║
  1908. ╙─────────────────────────────────╜
  1909.  
  1910. =N_DrvList('ADRIVES')
  1911. for n=1 to alen(aDrives,1)
  1912.     ?'Drive: '+aDrives[n,1],;
  1913.         iif(aDrives[n,2],'REMOTE','LOCAL'),;
  1914.         iif(aDrives[n,3],'REMOVABLE','FIXED')
  1915. endfor
  1916.  
  1917. * Local Removable Drives
  1918. =N_DrvList('ADRIVES',5)
  1919.  
  1920. * Local Fixed Drives
  1921. =N_DrvList('ADRIVES',9)
  1922.  
  1923. ───────────────────────────────────
  1924.  
  1925. See Also:    IsDiskIn()
  1926.  
  1927. ───────────────────────────────────
  1928.  
  1929. ____________________________________________________________________________
  1930. N_DrvPath() - Return Path for a drive letter.
  1931.  
  1932. Description
  1933.  
  1934.     Return the full NetWare path for a mapped drive.
  1935.  
  1936. Usage
  1937.  
  1938.     N_DrvPath( cDriveLetter )
  1939.  
  1940.         cDriveLetter is the drive letter to return the path for.
  1941.  
  1942. Return Values
  1943.  
  1944.     The NetWare path of the drive letter as a character string.  The path will be in the format <Volume>:<PATH>.  If the drive is not mapped, the function returns a null string.
  1945.  
  1946. ╓─────────────────────────────────╖
  1947. ║             Examples            ║
  1948. ╙─────────────────────────────────╜
  1949.  
  1950.     =N_MapDrive('sys:public','G')
  1951.     ?N_DrvPath('g')
  1952.         SYS:PUBLIC
  1953. ───────────────────────────────────
  1954.  
  1955. See Also:    N_DriveCnt(), N_MapDel(), N_MapDrive(), N_ServFrDr()
  1956.  
  1957. ───────────────────────────────────
  1958.  
  1959. ____________________________________________________________________________
  1960. N_Equivs() - Return all objects a specifed user is equivalent to
  1961.  
  1962. Description
  1963.  
  1964.     This function creates an array containing a list of objects the specified user is equivalent to.
  1965.  
  1966. Usage
  1967.  
  1968.     N_Equivs( cUserID, cArrayName [, .T. ])
  1969.  
  1970.         cUserID is the user ID to get equivalent listings for.  cUserID may not contain wild-cards.
  1971.  
  1972.         cArrayName is the name of the array to create.
  1973.  
  1974.         If the optional third parameter of .T. is passed, then the array created will be public.
  1975.  
  1976. Return Values
  1977.  
  1978.     Number of objects the user is equivalent to.  Creates an array containing the names of objects the user is equivalent to.  These objects can include user groups, or other users.
  1979.  
  1980. ╓─────────────────────────────────╖
  1981. ║             Examples            ║
  1982. ╙─────────────────────────────────╜
  1983.  
  1984.     n=N_Equivs('AOBJS',N_UserID())
  1985.     for i=1 to n
  1986.         ?aObjs[n]
  1987.     endfor
  1988.  
  1989. ───────────────────────────────────
  1990.  
  1991. See Also:    N_GroupsIn(), N_SecEquiv()
  1992.  
  1993. ───────────────────────────────────
  1994.  
  1995. ____________________________________________________________________________
  1996. N_FileInfo() - Return information about a file or files.
  1997.  
  1998. Description
  1999.  
  2000.     This function returns the NetWare specific information about a particular file or files.  This function is implemented as a find-first/find-next system.
  2001.  
  2002. Usage
  2003.  
  2004.     N_FileInfo( cFileSpec [, 1] )
  2005.     
  2006.         cFileSpec is the file specification to return information about.  The path should be in the format <VOLUME>:<PATH>\<FILESPEC>.
  2007.         
  2008.         1 is the optional second parameter to be used on the second and subsequent calls to this function.
  2009.  
  2010. Return Values
  2011.  
  2012.     The function returns information about the file in a comma-delimited list.  The format is:
  2013.  
  2014.         <FileName>, <FileSize>, <FileDate>, <FileTime>, <Attribute Flags>, <Extended Attribute Flags>, <Owner Name>, <Last Access Date>, <Last Access Time>, <Creation Date>, <Last Archived Date>, <Last Archived Time>
  2015.  
  2016.  
  2017. Comments
  2018.  
  2019.     This function is implemented as a find-first/find-next function because of the limitations of FoxPro.  Because the standard version of FoxPro can only have arrays with 3600 elements, if this function created an array it would fail on any directory having more than 300 files.
  2020.  
  2021. ╓─────────────────────────────────╖
  2022. ║             Examples            ║
  2023. ╙─────────────────────────────────╜
  2024. cFileSpec='SYS:USERS\'+N_UserID()+'\*.*'
  2025. create cursor FileInfo ( ;
  2026.     Name C(14), ;
  2027.     Size N(12), ;
  2028.     Date D(8), ;
  2029.     Time C(8), ;
  2030.     Attr C(10), ;
  2031.     ExtAttr C(10), ;
  2032.     Owner C(47), ;
  2033.     AccDate D(8), ;
  2034.     AccTime C(8), ;
  2035.     CreatDate D(8), ;
  2036.     ArcDate D(8), ;
  2037.     ArcTime C(8))
  2038.  
  2039. cInfo=N_FileInfo(cFileSpec)
  2040. do while not empty(cInfo)
  2041.     replace name with DelElem(cInfo,',',1), ;
  2042.         size with val(DelElem(cInfo,',',2)), ;    
  2043.         date with ctod(DelElem(cInfo,',',3)), ;
  2044.         time with DelElem(cInfo,',',4), ;
  2045.         Attr with DelElem(cInfo,',',5), ;
  2046.         ExtAttr with DelElem(cInfo,',',6), ;
  2047.         Owner with DelElem(cInfo,',',7), ;
  2048.         AccDate with ctod( DelElem(cInfo,',',8)), ;
  2049.         AccTime with DelElem(cInfo,',',9), ;
  2050.         CreatDate with ctod( DelElem(cInfo,',',10)), ;
  2051.         ArcDate with ctod( DelElem( cInfo,',',11)), ;
  2052.         ArcTime with DelElem(cInfo,',',12)
  2053.     cInfo=N_FileInfo(cFileSpec,1)
  2054. enddo
  2055. go top
  2056. browse
  2057. use
  2058.  
  2059. Function DelElem
  2060. Parameter cList, cDelimiter, nElement
  2061. Private cElement
  2062. if right(cList,1)!=cDelimiter
  2063.     cList=cList+cDelimiter
  2064. endif
  2065. if nElement > 1
  2066.     cList=substr(cList, at(cDelimiter, cList, nElement-1)+1)
  2067. endif
  2068. cElement=substr(cList,1,at(cDelimiter,cList)-1)
  2069. return cElement
  2070.  
  2071. ───────────────────────────────────
  2072.  
  2073. See Also:    N_SetAttr()
  2074.  
  2075. ───────────────────────────────────
  2076.  
  2077. ____________________________________________________________________________
  2078. N_FlushLPT() - Flush specified LPT port
  2079.  
  2080. Description
  2081.  
  2082.     The purpose of this function is to flush the specified LPT port.  This releases any job that is currently captured to that port to the network for processing.
  2083.  
  2084. Usage
  2085.  
  2086.     N_FlushLPT( [ iPortNumber ] )
  2087.  
  2088.     iPortNumber is the LPT port to flush.  If no parameter is passed, LPT1 is flushed.
  2089.  
  2090. Return Values
  2091.  
  2092.     0 always.
  2093.  
  2094. ───────────────────────────────────
  2095.  
  2096. See Also:    N_CapMode(), N_RdPParms(), N_StPParms()
  2097.  
  2098. ───────────────────────────────────
  2099.  
  2100. ____________________________________________________________________________
  2101. N_GetGroup() - Return List of groups on the server.
  2102.  
  2103. Description
  2104.  
  2105.     Create an array containing all groups on the default server.
  2106.  
  2107. Usage
  2108.  
  2109.     N_GetGroup( cArrayName[, cGroupSpec, cServerName, .T. ])
  2110.  
  2111.     cArrayName is the name of the array that will be created to hold the information returned.
  2112.  
  2113.     cGroupSpec is an option specifier that limits the names of the groups returned.
  2114.  
  2115.     cServerName is an optional server identifier.  You can specify a different server to get the acct list from (besides the default server).
  2116.  
  2117.     If a .T. is passed as the fourth parameter, the array created will be public.
  2118.  
  2119.  
  2120. Return Values
  2121.  
  2122.     The number of groups on the server.  The function also creates a two dimensional array where column 1 is the Group Name, and column 2 is the NetWare Object ID assigned to that group.
  2123.  
  2124. ╓─────────────────────────────────╖
  2125. ║             Examples            ║
  2126. ╙─────────────────────────────────╜
  2127.  
  2128.     *  The following example builds an array of all groups on the
  2129.     *  server, and performs a browse of them.
  2130.  
  2131.     Set library to gplib
  2132.     =N_GetGroup('GroupArr')
  2133.     create cursor Groups (GroupName C(48), OB_ID C(8))
  2134.     append from Array GroupArr
  2135.     browse
  2136.  
  2137.     *
  2138.     *  The second shows getting all groups from another server
  2139.  
  2140.     Set library to gplib
  2141.     =N_GetGroup('GroupArr','*','ADVERTISING')
  2142.     create cursor Groups (GroupName C(48), OB_ID C(8))
  2143.     append from Array GroupArr
  2144.     browse    
  2145.     
  2146. ───────────────────────────────────
  2147.  
  2148. See Also:    N_AcctList(), N_GetWild()
  2149.  
  2150. ───────────────────────────────────
  2151.  
  2152. ____________________________________________________________________________
  2153. N_GetLocks() - Return list of record/file locks for a file.
  2154.  
  2155. Description
  2156.  
  2157.     The purpose of this function is to return a list of record and file locks that workstations have on a particular file.
  2158.  
  2159. Usage
  2160.  
  2161.     N_GetLocks( cArrayName, cFileName [, cServer [, lPublic]] )
  2162.     
  2163.         cArrayName is the name of the array to store the information in.
  2164.         
  2165.         cFileName is the name of the file to get the lock status for.  The name of the file must be in the form VOLUME:PATH\FILENAME.EXT.
  2166.  
  2167.         cServer is an optional server name where the file is.  If this value is not passed, the default server is assumed.
  2168.  
  2169.         If the optional parameter lPublic is passed, and is true (.T.) then the array created will be public.  If this parameter is not passed, or is .F., then the array will be created private.
  2170.  
  2171. Return Values
  2172.  
  2173.     NetWare return code.
  2174.     
  2175.         152        File Not Found
  2176.         198        Not a Console Operator
  2177.         
  2178.     
  2179.         Upon successful completion, the function creates a three column array.  The array structure is:
  2180.  
  2181.             Connection Number
  2182.             Task Number
  2183.             Starting Byte Offset for Record Lock (See Comments)
  2184.  
  2185.         One row will be created for each record lock or file lock on the file.  In the case of a file lock, there will always be only one row returned.
  2186.  
  2187. Comments
  2188.  
  2189.     The starting Byte Offset returned will be dependent upon whether your file has a CDX or not.  Please refer to the sample program for information on interpreting this value.
  2190.  
  2191.     This function can be useful for finding out what station has a record lock, or a file locked.  This can be extremely useful in troubleshooting "deadly-embrace" situations.
  2192.  
  2193.     The person executing this function must be a console operator.  For more information on Console Operators, refer to your NetWare concepts manual.
  2194.  
  2195.     This function only returns shared-mode file and record locks.  If a file is used exclusively, it will not be reported by this function because it is not "locked", it is opened non-shareable.  Only files that have FLOCK()'s or RLOCKS()'s against them will be returned.
  2196.  
  2197.     Under Windows, and other multi-tasking operating systems, more than one task can have a file open, or have records locked.
  2198.  
  2199.     It is not possible to "peek ahead" to determine what stations are requesting a lock.  Short of placing an NLM on the server that would monitor lock calls, the only method of determining this is through the use of a hardware monitor.  One such monitor would be a Sniffer by Network General.
  2200.  
  2201.     This function requires that the GLOCKFIX.NLM patch be loaded on 3.11 and 3.12 servers.  This function will work without the patch but if there are more than 23 record locks applied, the server returns erroneous information.  The patch is available from Novell in the NetWire forum on CompuServe (Note: The name is the preliminary.  The actual name of the published file may be different).
  2202.  
  2203. ╓─────────────────────────────────╖
  2204. ║             Examples            ║
  2205. ╙─────────────────────────────────╜
  2206.  
  2207. cFile=Getfile('DBF','Select Database:')
  2208. if empty(cFile)
  2209.     return
  2210. endif
  2211. use (cFile) 
  2212. cAlias=alias()
  2213. =rlock()
  2214. =N_GetLocks('aLocks',DosToNet(dbf()))
  2215. if type('ALOCKS[1]')!='U'
  2216.     create cursor Locks (Station N(4), UserID C(30),  Offset N(12), Task N(3), RecNo N(9))
  2217.     append from array aLocks
  2218.     replace all recno with Ofs2RecNo(Offset,!empty(cdx(1,cAlias)), recsize(cAlias), fcount(cAlias)), ;
  2219.         UserID with N_UserID(Station)
  2220.     browse last
  2221.     use
  2222. endif
  2223. return
  2224.  
  2225. Function Ofs2RecNo
  2226. *
  2227. *    NOTE:     
  2228. *
  2229. *    DBF Files with CDX Files
  2230. *
  2231. *            If the returned record is greater than the
  2232. *            number of records in the database then a
  2233. *            file lock is in place.
  2234. *
  2235. *    DBF Files with No Index or .IDX files
  2236. *
  2237. *            If the returned record is 0 then the
  2238. *            record has an FLOCK() in place
  2239. *
  2240.  
  2241. Parameter nOffset, lHasCDX, nRecSize, nFCount
  2242.  
  2243. #DEFINE MAGIC_HAS_CDX 2147483646
  2244. * 0x7FFFFFFEL   Starting point for CDX Record locks
  2245.  
  2246. #DEFINE MAGIC_NO_CDX 1073741824
  2247. * 0x40000000L    Offset used in NON-CDX Record Locks
  2248.  
  2249. Private nRecord, nMaxRecords
  2250. if nOffset=0
  2251.     return 0
  2252. else
  2253.     if empty(nRecSize)
  2254.         nRecSize=RecSize()
  2255.         if empty(cdx(1))
  2256.             lHasCDX=.f.
  2257.         else
  2258.             lHasCDX=.t.
  2259.         endif
  2260.     endif
  2261.     if empty(nFCount)
  2262.         nFCount=fcount()
  2263.     endif
  2264.     if lHasCDX
  2265.         nRecord=MAGIC_HAS_CDX-nOffset
  2266.     else
  2267.         nOffset=nOffset-MAGIC_NO_CDX
  2268.         if nOffset> 0
  2269.             nRecord= ((nOffset-(33+32*nFCount))/nRecSize)+1
  2270.         else
  2271.             nRecord=0
  2272.         endif
  2273.     endif
  2274. endif
  2275. return nRecord
  2276. ───────────────────────────────────
  2277.  
  2278. See Also:    N_CUsing()
  2279.  
  2280. ───────────────────────────────────
  2281.  
  2282. ____________________________________________________________________________
  2283. N_GetQList() - Return a list of print queues.
  2284.  
  2285. Description
  2286.  
  2287.     Return a list of available print queues.
  2288.  
  2289. Usage
  2290.  
  2291.     N_GetQList( cArrayName[, cQueueSpec, cServerName, .T. ])
  2292.  
  2293.     cArrayName is the name of the array that will be created to hold the information returned.
  2294.  
  2295.     cQueueSpec is an optional specifier that limits the names of the queues returned.
  2296.  
  2297.     cServerName is an optional specifier that tells the routine what server you wish to get a queue list from.
  2298.  
  2299.     If a .T. is passed as the fourth parameter, the array created will be public.
  2300.  
  2301. Return Values
  2302.  
  2303.     Number of queues found, and creates a two dimensional array where column 1 is the Queue Names, and column 2 is the NetWare Object ID assigned to that Queue.  If a user does not have rights to a Queue, or that Queue has been set off by a Queue Operator (Users can place new Jobs in Queue set to NO) then that Queue will not be returned.
  2304.  
  2305. Comments
  2306.  
  2307.     The object ID returned by this procedure corresponds to the queue directory in the SYS:SYSTEM directory.
  2308.  
  2309.     For additional examples of how to use this function, please refer to the QMGR.PRG accompanying this program.
  2310.  
  2311. ╓─────────────────────────────────╖
  2312. ║             Examples            ║
  2313. ╙─────────────────────────────────╜
  2314.  
  2315.     *  The following example builds an array of queues on the
  2316.     *  server, and performs a browse of them.
  2317.  
  2318.     Set library to gplib
  2319.     =N_GetQList('QueueArr')
  2320.     create cursor Queues (QueueName C(48), Q_Id C(8))
  2321.     append from Array QueueArr
  2322.     browse
  2323.     
  2324.     * Get a List of HP Laser Queues from the engineering server
  2325.     
  2326.     =N_GetQList('AQUEUES','HPLJ*','ENGINEERING')
  2327.  
  2328. ───────────────────────────────────
  2329.  
  2330. See Also:    N_AcctList(), N_GetSList(), N_GetWild()
  2331.  
  2332. ───────────────────────────────────
  2333.  
  2334. ____________________________________________________________________________
  2335. N_GetSList() - Return a list of servers.
  2336.  
  2337. Description
  2338.  
  2339.     Return a list of available servers.
  2340.  
  2341. Usage
  2342.  
  2343.     N_GetSList( cArrayName [, cServerSpec, .T. ])
  2344.  
  2345.     cArrayName is the name of the array that will be created to hold the information returned.
  2346.  
  2347.     cServerSpec is the optional specification of server names to return.
  2348.  
  2349.     If a .T. is passed as the third parameter, the array created will be public.
  2350.  
  2351.  
  2352. Return Values
  2353.  
  2354.     Number of servers found, and creates a one dimensional array containing a list of known NetWare file servers.
  2355.  
  2356. ╓─────────────────────────────────╖
  2357. ║             Examples            ║
  2358. ╙─────────────────────────────────╜
  2359.  
  2360.     *  The following example builds an array of all servers on
  2361.     *  the network, and performs a browse of them.
  2362.  
  2363.     Set library to gplib
  2364.     =N_GetSList('ServerArr')
  2365.     create cursor Servers (ServerName C(48))
  2366.     append from Array ServerArr
  2367.     browse
  2368.  
  2369.     *    The second example shows how to create a public array
  2370.     *
  2371.     set library to gplib
  2372.     =N_GetSList('ServerArr','*',.T.)
  2373.     
  2374. ───────────────────────────────────
  2375.  
  2376. See Also:    N_Login(), N_LogOff(), N_ServAtch(), N_ServDtch(), N_Servers()
  2377.  
  2378. ───────────────────────────────────
  2379.  
  2380. ____________________________________________________________________________
  2381. N_GetWild() - Return Array listing all objects in bindery.
  2382.  
  2383. Description
  2384.  
  2385.     Return an array containing a list of all objects in the bindery.
  2386.  
  2387. Usage
  2388.  
  2389.     N_GetWild( cArrayName[, cObjectSpec, cServerName, .T. ])
  2390.  
  2391.     cArrayName is the name of the array to return the information to.
  2392.  
  2393.     cObjectSpec is an optional specifier that limits objects returned.
  2394.  
  2395.     cServerName is an optional specifier that permits reading the bindery of a server besides the default server.
  2396.  
  2397.     If a .T. is passed as the fourth parameter, the array created will be public.
  2398.  
  2399. Return Values
  2400.  
  2401.     The number of matches in the bindery.  Creates a two dimensional array with three columns that contain the Object Name, Object ID, and the Object Type as a hexidecimal string.
  2402.  
  2403.     Object Type meanings:
  2404.  
  2405.         0000h    -    Unknown
  2406.         0001h    -    User
  2407.         0002h    -    User Group
  2408.         0003h    -    Print Queue
  2409.         0004h    -    File Server
  2410.         0005h    -    Job Server
  2411.         0006h    -    Gateway
  2412.         0007h    -    Print Server
  2413.         0008h    -    Archive Queue
  2414.         0009h    -    Archive Server
  2415.         000Ah    -    Job Queue
  2416.         000Bh    -    Administration
  2417.         0024h    -    Remote Bridge Server
  2418.         0045h    -    Advertising Gateway Server?
  2419.         0047h    -    Advertising Print Server
  2420.         0048h    -    Advertising TCP IP Gateway Server?
  2421.         0066h    -    Advertising Archive Server?
  2422.         0107h    -    Remote Console (NetWare 3.X REMOTE.NLM, RSPX.NLM)
  2423.         030Ch    -    HP Laserjet Print Server
  2424.         8000h    -    Reserved up to 8000h
  2425.         8002h    -    LanPort/Netport
  2426.         FFFFh    -    Wild
  2427.  
  2428.     All object types above 8000h are available for developers to use as they see fit.  One interesting example of this is MicroTest LanPort/Intel NetPort devices have an object type of 8002h.
  2429.  
  2430. ╓─────────────────────────────────╖
  2431. ║             Examples            ║
  2432. ╙─────────────────────────────────╜
  2433.  
  2434.         Set library to gplib
  2435.         ?N_getwild('ObArray')
  2436.         create cursor ObArray (ObName C(48), OB_ID C(8), OB_TYPE C(4))
  2437.         append from array ObArray
  2438.         index on ob_type tag ob_type
  2439.         browse
  2440.  
  2441. ───────────────────────────────────
  2442.  
  2443. See Also:    N_AcctList(), N_GetGroup(), N_GetQList(), N_GetSList()
  2444.  
  2445. ───────────────────────────────────
  2446.  
  2447. ____________________________________________________________________________
  2448. N_GroupsIn() - Return a list of groups the specified user is in.
  2449.  
  2450. Description
  2451.  
  2452.     The purpose of this function is to create an array containing a list of groups the specified user is a member of.
  2453.  
  2454. Usage
  2455.  
  2456.     N_GroupsIn( cUserID, cArrayName [, .T. ] )
  2457.  
  2458.  
  2459.         cUserID is the user ID to get equivalent listings for.
  2460.  
  2461.         cArrayName is the name of the array to create.
  2462.  
  2463.         If the optional third parameter of .T. is passed, then the array created will be public.
  2464.  
  2465. Return Values
  2466.  
  2467.     Number of groups the user is a member of.  Creates an array containing the names of groups the user is in.
  2468.  
  2469. ╓─────────────────────────────────╖
  2470. ║             Examples            ║
  2471. ╙─────────────────────────────────╜
  2472.  
  2473.     n=N_GroupsIn(N_UserID(), 'AGROUPS')
  2474.     for i=1 to n
  2475.         ?aGroups[n]
  2476.     endfor
  2477.  
  2478. ───────────────────────────────────
  2479.  
  2480. See Also:    N_Equivs(), N_GetGroup(), N_GrpMbrs(), N_SecEquiv()
  2481.  
  2482. ───────────────────────────────────
  2483.  
  2484. ____________________________________________________________________________
  2485. N_GrpMbrs() - Return list of users in a group
  2486.  
  2487. Description
  2488.  
  2489.     The purpose of this function is to create a list of members of a specified user group.
  2490.  
  2491. Usage
  2492.  
  2493.     N_GrpMbrs( cGroupName, cArrayName [, .T. ])
  2494.  
  2495.         cGroupName is the name of the group to examine.
  2496.  
  2497.         cArrayName is the name of the array to create.
  2498.  
  2499.         If the optional third parameter of .T. is passed, then the array created will be public.
  2500.  
  2501. Return Values
  2502.  
  2503.     Number of members of the group.  Creates an array containing the user IDs for all members of the group.
  2504.  
  2505.  
  2506. ╓─────────────────────────────────╖
  2507. ║             Examples            ║
  2508. ╙─────────────────────────────────╜
  2509.  
  2510. *
  2511. *    Purpose:    Send message to users who are logged in, and are part of a
  2512. *   specified group.  If no group is specified, group EVERYONE is assumed.
  2513. *
  2514.  
  2515. parameters Message, GroupName
  2516. private NumStations, n, StationCount, LastMode, aMembers
  2517.  
  2518. message = alltrim(Message)
  2519. if len(message) > 55 .or. len(message) = 0
  2520.     return - 1
  2521. endif
  2522.  
  2523. if empty('GroupName') <> 'C'
  2524.     GroupName = "EVERYONE"
  2525. else
  2526.     GroupName = alltrim(GroupName)
  2527. endif
  2528.  
  2529. LastMode = N_MsgMode()
  2530. = N_MsgMode(1)                        && set it so we don't get our own message
  2531. StationCount = 0
  2532. nUsers=N_GrpMbrs('aMembers',GroupName)
  2533. for n = 1 to nUsers
  2534.     if N_LoggedIn(aMembers[n])
  2535.         StationCount = StationCount + N_MsgBrd(Message, aMembers[n])
  2536.     endif
  2537. endfor
  2538. = N_MsgMode(LastMode)
  2539. return StationCount
  2540.  
  2541. ───────────────────────────────────
  2542.  
  2543. See Also:    N_Equivs(), N_GroupsIn(), N_SecEquiv()
  2544.  
  2545. ───────────────────────────────────
  2546.  
  2547. ____________________________________________________________________________
  2548. N_LIStat() - Query/Set Login State On Server
  2549.  
  2550. Description
  2551.  
  2552.     Read the current login status, or change the current login status for the default server.
  2553.  
  2554. Usage
  2555.  
  2556.     N_LIStat( [lMode] )
  2557.  
  2558.         if lMode is ommitted, the function returns the current login state on the default server (.T. if enabled, or .F. if disabled.)
  2559.  
  2560.         If lMode is .T., it enables login on the server.
  2561.  
  2562.         If lMode is .F., it disables login on the server.
  2563.  
  2564. Return Values
  2565.  
  2566.     If lMode is ommitted, the function returns .T. if login is enabled on the server, and .F. if not.
  2567.  
  2568.     If lMode is passed, the function returns .T. if the login state is changed, otherwise it returns .f.
  2569.  
  2570. Comments
  2571.  
  2572.     You must be a console operator to make this call successfully.
  2573.  
  2574. ───────────────────────────────────
  2575.  
  2576. See Also:    N_ConsOper()
  2577.  
  2578. ──────────────────────────────────
  2579.  
  2580. ____________________________________________________________________________
  2581. N_LoggedIn() - Return whether a specified user is logged in.
  2582.  
  2583. Description
  2584.  
  2585.     Return whether a specified user is logged into the network.
  2586.  
  2587. Usage
  2588.  
  2589.     N_LoggedIn( cUserID )
  2590.  
  2591.         cUserID is the name of the user to check login status for.
  2592.  
  2593. Return Values
  2594.  
  2595.     .T. if specified user is logged into the network, .F. otherwise.
  2596.  
  2597. ╓─────────────────────────────────╖
  2598. ║             Examples            ║
  2599. ╙─────────────────────────────────╜
  2600.  
  2601.     IF N_LoggedIn('SUPERVISOR')
  2602.         N_MsgBrd("The payroll program is being accessed by "+; N_UserID(),"SUPERVISOR")
  2603.     ENDIF
  2604.     *  Access the payroll program
  2605.     USE PAYROLL
  2606.  
  2607. ───────────────────────────────────
  2608.  
  2609. See Also:    N_MsgBrd()
  2610.  
  2611. ───────────────────────────────────
  2612.  
  2613. ____________________________________________________________________________
  2614. N_Login() - Login to file server.
  2615.  
  2616. Description
  2617.  
  2618.     Login a station into a file server.
  2619.  
  2620. Usage
  2621.  
  2622.     N_Login( cLoginID, cPassword, cServerName )
  2623.  
  2624.     cLoginID is the login ID to use.
  2625.  
  2626.     cPassword is the password for the login ID specified.
  2627.  
  2628.     cServerName is the server's name.
  2629.  
  2630.  
  2631. Return Values
  2632.  
  2633.     NetWare completion code:
  2634.  
  2635.         0    -    Successful
  2636.         197    -    Intruder detection activated
  2637.         220    -    Account Disabled
  2638.         252 -    No Such Object
  2639.         254    -    Login Disabled
  2640.         255    -    No Response From Server
  2641.  
  2642. Comments
  2643.  
  2644.     If the login attempt was unsuccessful, you will still be attached to the server you tried to login to.
  2645.  
  2646.     Executing this command WILL NOT execute either the system login script, or the users specific login script.  It will be up to your program to provide any drive-mappings, or captures that would noramlly be done via the login script.
  2647.  
  2648.     
  2649. ╓─────────────────────────────────╖
  2650. ║             Examples            ║
  2651. ╙─────────────────────────────────╜
  2652.  
  2653.     set talk off
  2654.     Set library to gplib
  2655.     =N_GetSList('SLIST')
  2656.     clear
  2657.     store space(48) to userid, pword
  2658.     && Note: password can actually be 127 characters long
  2659.     s_name=slist[1]
  2660.     @3,5 Say "Server Name : " get s_name function '^' from SLIST
  2661.     @7,5 Say "User ID : " Get Userid
  2662.     @9,5 Say "Password: " Get Pword
  2663.     read
  2664.     s_name=alltrim(s_name)
  2665.     userid=alltrim(userid)
  2666.     pword=alltrim(pword)
  2667.     result=N_Login(userid,pword,s_name)
  2668.     if result =0
  2669.         wait window 'Successfully logged in to file server : '+s_name
  2670.     else
  2671.         wait window 'Login FAILED.  Result code was :'+ltrim(str(result))
  2672.     endif
  2673.  
  2674. ───────────────────────────────────
  2675.  
  2676. See Also:    N_LogOff(), N_ServAtch(), N_ServDtch()
  2677.  
  2678. ───────────────────────────────────
  2679.  
  2680. ____________________________________________________________________________
  2681. N_LogInfo() - Get a workstations login date or time
  2682.  
  2683. Description
  2684.  
  2685.     Read the login date or time for a specified workstation.
  2686.  
  2687. Usage
  2688.  
  2689.     N_LogInfo( iWorkStation , 1 || 2)
  2690.  
  2691.     If iWorkStation is 0, the login date for the user on the current station is returned, otherwise the login date or time for the user on the specified work-station is returned.
  2692.  
  2693.     If the second parameter passed is 1, then the login date for the specified work station will be returned.
  2694.  
  2695.     If the second parameter passed is 2, then the login time for the specified work station will be returned.
  2696.  
  2697. Return Values
  2698.  
  2699.     Login date or time for specified work-station.
  2700.  
  2701. ╓─────────────────────────────────╖
  2702. ║             Examples            ║
  2703. ╙─────────────────────────────────╜
  2704.  
  2705.     ?N_LogInfo(0,1) && Print login date as date variable for my station
  2706.         08/22/93
  2707.         
  2708.     
  2709.     For LoopVar= 1 to N_MaxConns()
  2710.         if (Date()-ctod(N_LogInfo(LoopVar,1))) > 1
  2711.             ? N_UserID(LoopVar)+' Logged in at '+N_LogInfo(LoopVar,1)+;
  2712.                 ' and has not logged out as of : '+dtoc(date())
  2713.         endif
  2714.     EndFor
  2715.  
  2716. ───────────────────────────────────
  2717.  
  2718. See Also:    N_UserID(), N_UserName()
  2719.  
  2720. ───────────────────────────────────
  2721.  
  2722. ____________________________________________________________________________
  2723. N_LogOff() - Logout from a specified file server.
  2724.  
  2725.  
  2726. Description
  2727.  
  2728.     Log the user out of the specified file server
  2729.  
  2730. Usage
  2731.  
  2732.     N_LogOff( [cServerName, lDetach] )
  2733.  
  2734.         cServerName is the name of the server to logout from.  If this parameter is not passed, you will be logged out of all servers.
  2735.  
  2736.         lDetach is an optional parameter.  If .T., then you will be detached from the specified server once you are logged out.  If .F., you will be left attached to the specified server once you are logged out.
  2737.  
  2738. Return Values
  2739.  
  2740.     .T. if successful, .F. otherwise.
  2741.  
  2742. Comments
  2743.  
  2744.     If you use the detach option of this function, you must reset the server to a valid server (refer to example).
  2745.  
  2746. ╓─────────────────────────────────╖
  2747. ║             Examples            ║
  2748. ╙─────────────────────────────────╜
  2749.  
  2750.     cServer=N_DefServr()    && Save current server
  2751.     *  Login to the engineering server and copy a file to it then logout.
  2752.     =N_Login("Engineering","Joe","BLOW")
  2753.     =N_MapDrive("G","SYS:DBDATA","ENGINEERING")
  2754.     copy file dataFile.dbf to g:\dbdata\datafile.dbf
  2755.     =N_LogOff('ENGINEERING',.T.)
  2756.     =N_DefServr(cServer)    && Restore old server
  2757.  
  2758. ───────────────────────────────────
  2759.  
  2760. See Also:    N_Login(), N_ServDtch()
  2761.  
  2762. ───────────────────────────────────
  2763.  
  2764.  
  2765. ____________________________________________________________________________
  2766. N_LongMach() - Return Long Machine Type
  2767.  
  2768. Description
  2769.  
  2770.     The purpose of this function is to return the long machine type of the executing station.
  2771.  
  2772. Usage
  2773.  
  2774.     N_LongMach()
  2775.  
  2776. Comments
  2777.  
  2778.     For information concerning machine types, refer to Novell's installation manuals, concerning the SHELL.CFG file.
  2779.  
  2780. ╓─────────────────────────────────╖
  2781. ║             Examples            ║
  2782. ╙─────────────────────────────────╜
  2783.  
  2784.     If N_LongMach()='NOHARD'    &&    Purely a local convention, established for our network.
  2785.         ?' This machine has no hard drive'
  2786.     endif
  2787.  
  2788. ───────────────────────────────────
  2789.  
  2790. See Also:    N_ShellVer(), N_ShrtMach()
  2791.  
  2792. ───────────────────────────────────
  2793.  
  2794. ____________________________________________________________________________
  2795. N_LstQJobs() - Create array containing current print jobs for a queue.
  2796.  
  2797.  
  2798. Description
  2799.  
  2800.     Create a two dimensional array containing the current printjob entries for the specified print queue.
  2801.  
  2802. Usage
  2803.  
  2804.     N_LstQJobs( cQueueName, cArrayName [, cServerName, .T. ] )
  2805.  
  2806.         cQueueName is the queue to get the job list for.
  2807.  
  2808.         cArrayName is the name of the array to create.
  2809.  
  2810.         cServerName is the optional server name the queue resides on.
  2811.  
  2812.         If the optional fourth parameter .t. is included, the array created will be public.
  2813.  
  2814. Return Values
  2815.  
  2816.     Number of printjobs if successful, otherwise returns error code as a number > 10000.  If the call was successful, a two dimensional array will be created holding the print job information.  The columns are:
  2817.  
  2818.         1    Job Number
  2819.         2    Job Size
  2820.         3    Job Description
  2821.         4    Job Owner
  2822.         5    Job Status    ( Active, Adding, Ready, Hold-User, Hold-Oper )
  2823.  
  2824.     Error Numbers
  2825.  
  2826.         10,208    -    Queue Error
  2827.         10,209    -    No Queue
  2828.         10,211    -    No Queue Rights
  2829.         10,213    -    No Queue Job
  2830.         10,254    -    Server Bindery Locked
  2831.         10,255    -    Bindery Failure
  2832.  
  2833. Comments
  2834.  
  2835.     Because of design limitations in the Novell Queue system the maximum number of print jobs this function can return is 250.  Under NetWare 3.X, the maximum number of print jobs is actually 65535.
  2836.  
  2837.     In order to use this and other Queue functions the following conditions must apply.
  2838.  
  2839.         To use N_LstQJobs() you must be either a queue user, or a queue operator.
  2840.  
  2841.         To use N_DelQJob() you must be either the Job Owner, or a queue operator.
  2842.  
  2843.         To use N_MoveQJob() you must be a queue operator.
  2844.  
  2845.     For more information on how Novell handles queue rights and how to create queue operators, please refer to your NetWare documentation.
  2846.  
  2847.  
  2848. ╓─────────────────────────────────╖
  2849. ║             Examples            ║
  2850. ╙─────────────────────────────────╜
  2851.  
  2852.     ?N_LstQJobs('PRINTQ_0','QArray')  && get jobs for Printq_0
  2853.  
  2854.  
  2855.     For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.
  2856.  
  2857. ───────────────────────────────────
  2858.  
  2859. See Also:    N_DelQJob(), N_GetQList(), N_MoveQJob()
  2860.  
  2861. ───────────────────────────────────
  2862.  
  2863. ____________________________________________________________________________
  2864. N_MapDel() - Delete a drive mapping.
  2865.  
  2866. Description
  2867.  
  2868.     Delete a network drive mapping.
  2869.  
  2870. Usage
  2871.  
  2872.     N_MapDel( cLetter )
  2873.  
  2874.         cLetter is the drive letter to delete.
  2875.  
  2876. Return Values
  2877.  
  2878.     0    -    Success
  2879.     155    -    Bad Directory Handle
  2880.  
  2881. ───────────────────────────────────
  2882.  
  2883. See Also:    N_DrvPath(), N_MapDrive(), N_MapRoot(), N_ServFrDr()
  2884.  
  2885. ───────────────────────────────────
  2886.  
  2887. ____________________________________________________________________________
  2888. N_MapDrive() - Map a drive
  2889.  
  2890. Description
  2891.  
  2892.     The purpose of this function is to map a drive on the network.
  2893.  
  2894. Usage
  2895.  
  2896.     N_MapDrive( cPath, cLetter [,cServerName ] )
  2897.  
  2898.     cPath is the path in the form '<VOLUME>:<DIRECTORY>'
  2899.  
  2900.     cLetter is the drive letter.
  2901.  
  2902.     cServerName is the optional name of the file server to map the drive on.
  2903.  
  2904. Return Values
  2905.  
  2906.     0    -    Success
  2907.     152    -    Volume Does Not Exist
  2908.     156    -    Path does not exist
  2909.     255    -    Path not locatable
  2910.  
  2911. ╓─────────────────────────────────╖
  2912. ║             Examples            ║
  2913. ╙─────────────────────────────────╜
  2914.  
  2915.     ?N_MapDrive('sys:public','M')
  2916.         0
  2917.  
  2918.     ?N_MapDrive('SYS:DBDATA','M','ENGINEERING')
  2919.     && Map drive m to SYS:DBDATA on the ENGINEERING server.
  2920.  
  2921. ───────────────────────────────────
  2922.  
  2923. See Also:    N_DrvPath(), N_MapDel(), N_MapRoot(), N_ServFrDr()
  2924.  
  2925. ───────────────────────────────────
  2926.  
  2927. ____________________________________________________________________________
  2928. N_MapRoot() - Create a fake root drive mapping
  2929.  
  2930. Description
  2931.  
  2932.     The purpose of this routine is to create a fake root drive mapping.
  2933.  
  2934. Usage
  2935.  
  2936.     N_MapRoot(  cPath , cDrive)
  2937.  
  2938.         cPath is the path to map to.  The path may include server/volume names.
  2939.  
  2940.         cDrive is the drive letter to map to.
  2941.  
  2942. Return Values
  2943.  
  2944.     0    -    Success
  2945.     152    -    Volume Does Not Exist
  2946.     156    -    Path does not exist
  2947.     255    -    Path not locatable
  2948.  
  2949. ╓─────────────────────────────────╖
  2950. ║             Examples            ║
  2951. ╙─────────────────────────────────╜
  2952.  
  2953.     ?N_MapRoot('sys:public','M')
  2954.         0
  2955.  
  2956.     * Map drive m to SYS:DBDATA on the ENGINEERING server.
  2957.     ?N_MapRoot('ENGINEERING\SYS:DBDATA','M')
  2958.         0
  2959.  
  2960. ───────────────────────────────────
  2961.  
  2962. See Also:    N_DrvDepth(), N_DrvPath(), N_MapDel(), N_MapDrive(), N_ServFrDr()
  2963.  
  2964. ───────────────────────────────────
  2965.  
  2966. ____________________________________________________________________________
  2967. N_MaxConns() - Return Maximum NetWare connections.
  2968.  
  2969. Description
  2970.  
  2971.     Return the highest number of NetWare connections supported by the default server.
  2972.  
  2973. Usage
  2974.  
  2975.     N_MaxConns()
  2976.  
  2977. Return Values
  2978.  
  2979.     Integer corresponding to the maximum number of concurrent logins the license for the default server permits.
  2980.  
  2981. Comments
  2982.  
  2983.     Interestingly, some NLMs will "login" to the server at connection numbers higher than the License will permit.  One example of this is the ArcServer from Cheyenne Software.  Another example is the PSERVER NLM from Novell.
  2984.  
  2985. ╓─────────────────────────────────╖
  2986. ║             Examples            ║
  2987. ╙─────────────────────────────────╜
  2988.  
  2989.     for n= 1 to N_MaxConns()
  2990.         ?N_UserID(n), N_UserName(n)
  2991.     endfor
  2992.  
  2993. ───────────────────────────────────
  2994.  
  2995. See Also:    N_UserID(), N_UserName()
  2996.  
  2997. ───────────────────────────────────
  2998.  
  2999. ____________________________________________________________________________
  3000. N_MemberOf() - Return Group Membership
  3001.  
  3002. Description
  3003.  
  3004.     The purpose of this function is to return true if the person specified is a member of a specified group.
  3005.  
  3006. Usage
  3007.  
  3008.     N_MemberOf( cUserName, cGroupName )
  3009.  
  3010.     cUserName is the name of the person to check membership for.
  3011.  
  3012.     cGroupName is the name of the group to check membership for.
  3013.  
  3014. Return Values
  3015.  
  3016.     .T. if user is member of specified group, .F. otherwise.
  3017.  
  3018. Comments
  3019.  
  3020.     An interesting place to use this function is in the MENU Builder, SKIP FOR condition.  This allows you to have menu options that are only highlighted if the person is a member of the appropriate group.
  3021.  
  3022. ╓─────────────────────────────────╖
  3023. ║             Examples            ║
  3024. ╙─────────────────────────────────╜
  3025.  
  3026.     if .not. N_MemberOf(N_UserID(), 'HR')
  3027.         WAIT WINDOW 'Error! You are not authorized to execute this program!'
  3028.         CANCEL
  3029.     endif
  3030.  
  3031. ───────────────────────────────────
  3032.  
  3033. See Also:    N_GetGroup(), N_SecEquiv()
  3034.  
  3035. ───────────────────────────────────
  3036.  
  3037. ____________________________________________________________________________
  3038. N_MoveQJob() - Move a job within a queue
  3039.  
  3040. Description
  3041.  
  3042.     Change the servicing priority for a job in a NetWare queue.
  3043.  
  3044. Usage
  3045.  
  3046.     N_MoveQJob( iNewPosition, iJobNumber, cQueueName [, cServerName ] )
  3047.  
  3048.         iNewPosition is the new printjob service position
  3049.  
  3050.         iJobNumber is the NetWare print job Number.
  3051.  
  3052.         cQueueName is the print queue name.
  3053.  
  3054.         cServerName is the optional server name where the queue resides
  3055.  
  3056. Return Values
  3057.  
  3058.     NetWare completion code.
  3059.  
  3060.         0    -    Success
  3061.         208    -    Queue Error
  3062.         209    -    No Queue
  3063.         211    -    No Queue Rights
  3064.         213    -    No Queue Job
  3065.         214    -    No Job Rights
  3066.         254    -    Server Bindery Locked
  3067.         255    -    Bindery Failure
  3068.  
  3069. Comments
  3070.  
  3071.     If iNewPosition is greater than the number of jobs currently in the queue, the job will placed at the end of the queue.
  3072.  
  3073.     Please refer to the Comments section for N_LstQJobs() for additional information.
  3074.  
  3075. ╓─────────────────────────────────╖
  3076. ║             Examples            ║
  3077. ╙─────────────────────────────────╜
  3078.  
  3079.     ?N_MoveQJob(1,272,'PRINTQ_0')  && Move job 272 to Position 1
  3080.  
  3081.     For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.
  3082.  
  3083. ───────────────────────────────────
  3084.  
  3085. See Also:    N_DelQJob(), N_GetQList(), N_LstQJobs()
  3086.  
  3087. ───────────────────────────────────
  3088.  
  3089. ____________________________________________________________________________
  3090. N_MsgBrd() - Send a message to another network user.
  3091.  
  3092. Description
  3093.  
  3094.     Send a broadcast message to other workstations on the network.
  3095.  
  3096. Usage
  3097.  
  3098.     N_MsgBrd(  cUserID, cMessage )
  3099.  
  3100.         cUserID is the Login ID to send the message to.
  3101.         
  3102.         cMessage is the message to send.
  3103.  
  3104.  
  3105. Return Values
  3106.  
  3107.     The number of stations the message was sent to.
  3108.  
  3109. ╓─────────────────────────────────╖
  3110. ║             Examples            ║
  3111. ╙─────────────────────────────────╜
  3112.  
  3113.     clear
  3114.     Store space(55) to Msg
  3115.     store space(48) to UserID
  3116.     @5,5 Say "Please enter the message : " Get MSG Picture "@S30"
  3117.     @7,5 Say "Enter the users name     : " Get UserID picture "@S30"
  3118.     Read
  3119.     Result=N_MsgBrd(msg, Alltrim(UserID))
  3120.     If result > 0
  3121.             wait window "The message was sent to "+alltrim(UserID)+" on "+;
  3122.                 alltrim(str(result))+" station(s)."
  3123.         endif
  3124.     else
  3125.         Wait window "The message was not sent to "+alltrim(UserID)
  3126.     endif
  3127.  
  3128. ───────────────────────────────────
  3129.  
  3130. See Also:    N_MsgMode(), N_MsgRtrv()
  3131.  
  3132. ───────────────────────────────────
  3133.  
  3134.  
  3135. ____________________________________________________________________________
  3136. N_MsgMode() - Read/Set Current Broadcast Mode
  3137.  
  3138. Description
  3139.  
  3140.     Read/Return the current broadcast mode setting for the work station.
  3141.  
  3142. Usage
  3143.  
  3144.     N_MsgMode( [iState] )
  3145.     
  3146.         iState is an optional parameter.  If this parameter is not passed, the current mode is returned.  If this parameter is passed, then the message mode will be set to that specified.  Valid modes are:
  3147.  
  3148.             0    =    Equivalent to CASTON.  All messages will be received
  3149.             1    =    Equivalent to CASTOFF. Messages from server will be accepted.  Messages from users will be discarded.
  3150.             2    =    Equivalent to CASTOFF /ALL.  Messages from both the server, and other workstations will be disregarded.  Messages from the server will be saved, and may be recalled with a call to N_MsgRtrv().
  3151.             3    =    Messages from both the server and other workstations will be stored at the server.  The station may recall the messages by a call to N_MsgRtrv().
  3152.  
  3153. Return Values
  3154.  
  3155.     Current station broadcast mode (See Usage).
  3156.  
  3157.  
  3158. Comments
  3159.  
  3160.     If there is a message in the server buffer, waiting and the N_MsgMode() mode is changed from a store mode to 0, then that message will be immediately retrieved and displayed.
  3161.  
  3162. ───────────────────────────────────
  3163.  
  3164. See Also:    N_MsgBrd(), N_MsgRtrv()
  3165.  
  3166. ───────────────────────────────────
  3167.  
  3168. ____________________________________________________________________________
  3169. N_MsgRtrv() - Retrieve a stored message from the file server.
  3170.  
  3171. Description
  3172.  
  3173.     Retrieve a stored message from the file server.  Messages can be stored if the mode is set using N_MsgMode() to 2 or 3.
  3174.  
  3175. Usage
  3176.  
  3177.     N_MsgRtrv()
  3178.  
  3179. Return Values
  3180.  
  3181.     A string containing the stored message (or a null string if no message is waiting) if successful.  If the call is unsuccessful, the function returns .F.
  3182.  
  3183.  
  3184. ╓─────────────────────────────────╖
  3185. ║             Examples            ║
  3186. ╙─────────────────────────────────╜
  3187.  
  3188.     =N_MsgMode(3)    && save messages from users and the server
  3189.     Do while .t.
  3190.         *  Perform processing
  3191.         Msg=N_MsgRtrv()
  3192.         if Type(Msg)='C' .and. .not. empty(Msg)
  3193.             wait window msg timeout 10
  3194.         endif
  3195.     enddo
  3196.  
  3197. ───────────────────────────────────
  3198.  
  3199. See Also:    N_MsgMode()
  3200.  
  3201. ───────────────────────────────────
  3202.  
  3203. ____________________________________________________________________________
  3204. N_PwdDate() - Return date user's password expires.
  3205.  
  3206. Description
  3207.  
  3208.     Return the date a users password expires
  3209.  
  3210. Usage
  3211.  
  3212.     N_PwdDate( [ cUserID ] )
  3213.  
  3214.     cUserID is the optional user ID to get the date for.
  3215.  
  3216. Return Values
  3217.  
  3218.     Date network password expires as a DATE type.
  3219.  
  3220. Comments
  3221.  
  3222.     To get the password for any user besides himself, the person executing this program must equivalent to that user, a manager over that user, or a supervisor equivalent.
  3223.  
  3224. ╓─────────────────────────────────╖
  3225. ║             Examples            ║
  3226. ╙─────────────────────────────────╜
  3227.  
  3228.     ?N_PwdDate()
  3229.         05/19/92
  3230.  
  3231. ───────────────────────────────────
  3232.  
  3233. See Also:    N_AccsDate(), N_UserName()
  3234.  
  3235. ───────────────────────────────────
  3236.  
  3237. ____________________________________________________________________________
  3238. N_RdPParms() - Get current capture settings.
  3239.  
  3240. Description
  3241.  
  3242.     To read the current capture parameters.  This function allows programs to read the current capture parameters including FormFeed, Setup Strings, Reset Strings, Notify, Banner, etc.
  3243.  
  3244. Usage
  3245.  
  3246.     N_RdPParms( cArrayName, iLPTPort [, .T. ])
  3247.  
  3248.         cArrayName is the name of the array to create.
  3249.  
  3250.         iLPTPort is the LPT Port to read. I.E. 1-3.
  3251.  
  3252.         If the optional parameter of .T. is included, the array will be created as a public array.
  3253.  
  3254.  
  3255. Return Values
  3256.  
  3257.     .T. always.  The function also creates a 15 Element, 1 dimensional array that contains the capture parameters.  Please refer to the list below for a description of each element.
  3258.  
  3259.  
  3260.     Row            Contents
  3261.  
  3262.     1            Printer Setup Codes
  3263.     2            Printer Reset Codes
  3264.     3            Server Name
  3265.     4            Queue Name
  3266.     5            Form Number (0-255)
  3267.     6            Form Name
  3268.     7            Tab Size
  3269.     8            Tab Expansion ( .t. or .f. )
  3270.     9            Form Feed Flag ( .t. or .f. )
  3271.     10            Notification Flag ( .t. or .f. )
  3272.     11            AutoEndCap Flag ( .t. or .f. )
  3273.     12            Banner Text
  3274.     13            Banner Flag ( .t. or .f.)
  3275.     14            Number of Copies (1-255)
  3276.     15            Timeout in Seconds
  3277.  
  3278. Comments
  3279.  
  3280.     Even if you use N_CapMode() or ENDCAP to end capture, this function will still return the parameters for your last effective capture.  This is not an undocumented feature, it is just how NetWare works.
  3281.  
  3282.     The form name field is for information only.  It is totally disregarded by NetWare.  If you use the N_StPParms() function, changing the Form Name will have absolutely no effect.
  3283.  
  3284.     If you use form numbers, you must ensure that your customers understand forms, and more specifically how to inform NetWare that a form has been mounted.
  3285.  
  3286.     The Printer Setup Codes and Printer Reset Codes are fixed length fields.  When a station issues a capture with a J= parameter, these fields are where the setup and reset strings are stored.  The default values for the size of these two buffers is 64 and 16 bytes respectively.  If you wish to set aside a larger area for these buffers, you must put a setting in your SHELL.CFG file.  For more specific information, please refer to your NetWare Installation manual.
  3287.  
  3288. ╓─────────────────────────────────╖
  3289. ║             Examples            ║
  3290. ╙─────────────────────────────────╜
  3291.  
  3292.     external array p_array
  3293.     =N_RdPParms('P_Array',1)
  3294.     Wait Window 'The current Queue is '+P_Array[4]+;
  3295.         '.  The current server is '+P_Array[3]
  3296.  
  3297. ───────────────────────────────────
  3298.  
  3299. See Also:    N_CapMode(), N_FlushLPT(), N_StPParms(), N_UserBnnr()
  3300.  
  3301. ───────────────────────────────────
  3302.  
  3303.  
  3304. ____________________________________________________________________________
  3305. N_SecEquiv() - Return Security Equivalence
  3306.  
  3307. Description
  3308.  
  3309.     The purpose of this function is to return true if the person on the executing machine is equivalent to the specified user.
  3310.  
  3311. Usage
  3312.  
  3313.     N_SecEquiv( cUserToCheck, cUserName )
  3314.  
  3315.     cUserToCheck is the name of the person to check equivalence for.
  3316.  
  3317.     cUserName is the name of the user to check equivalence with.
  3318.  
  3319. Return Values
  3320.  
  3321.     .T. if cUserName is equivalent to cUserToCheck, .F. otherwise.
  3322.  
  3323. ╓─────────────────────────────────╖
  3324. ║             Examples            ║
  3325. ╙─────────────────────────────────╜
  3326.  
  3327.     If .not. N_SecEquiv( N_UserID(), 'Supervisor')
  3328.         WAIT WINDOW 'You must be a supervisor equivalent to run this program!'
  3329.         CANCEL
  3330.     endif
  3331.  
  3332. ───────────────────────────────────
  3333.  
  3334. See Also:    N_MemberOf()
  3335.  
  3336. ───────────────────────────────────
  3337.  
  3338. ____________________________________________________________________________
  3339. N_SerialNo() - Return NetWare Server Serial Number
  3340.  
  3341. Description
  3342.  
  3343.     Return the NetWare serial number for the default server.
  3344.  
  3345. Usage
  3346.  
  3347.     N_SerialNo()
  3348.  
  3349. Return Values
  3350.  
  3351.     8 digit NetWare serial number formatted as a character string.
  3352.  
  3353. Comments:
  3354.  
  3355. Each copy of NetWare sold by Novell is serialized.  This function returns that Novell assigned serial number.  The exception to this is major accounts.  Novell has entered into site license agreements with some very large corporations.  It is entirely possible for one of these sites to have two servers with the same serial number.
  3356.  
  3357. You must be logged in to the server to get the serial number.
  3358.  
  3359. ╓─────────────────────────────────╖
  3360. ║             Examples            ║
  3361. ╙─────────────────────────────────╜
  3362.  
  3363. ?N_SerialNo()   && Get serial number of default server
  3364.  
  3365. =N_DefServr('ENGINEERING')   && Set default server to engineering
  3366. ?N_SerialNo()                  && and read it's serial number
  3367.  
  3368. ____________________________________________________________________________
  3369. N_ServAtch() - Attach to a file server.
  3370.  
  3371. Description
  3372.  
  3373.     Attach to a NetWare file server but not login.
  3374.  
  3375. Usage
  3376.  
  3377.     N_ServAtch(  cServerName )
  3378.  
  3379.     cServerName is the name of the file server to attach to.
  3380.  
  3381. Return Values
  3382.  
  3383.     .T. always
  3384.  
  3385. Comments
  3386.  
  3387.     This function allows you to attach to different servers without logging in or out.  This permits you to perform some operations, such as getting the MaxConnections, the server date and time, etc. without logging into that server.
  3388.  
  3389.     Also note that you can only be logged in or attached to 8 file servers using the NetX shells.  Using the VLM shells you can attach to more than 8 servers.  This function does not support VLM shells.  Trying to attach to more than 8 servers will generate an Error 1098, 'All connection slots in use.'
  3390.  
  3391. ───────────────────────────────────
  3392.  
  3393. See Also:    N_Attached(), N_DefServr(), N_LogOff(), N_Login(), N_ServDtch()
  3394.  
  3395. ───────────────────────────────────
  3396.  
  3397.  
  3398. ____________________________________________________________________________
  3399. N_ServDate() - Return server date.
  3400.  
  3401. Description
  3402.  
  3403.     Return the current system date from the network file server.
  3404.  
  3405. Usage
  3406.  
  3407.     N_ServDate()
  3408.  
  3409. Return Values
  3410.  
  3411.     Server date as a Date variable.
  3412.  
  3413. ╓─────────────────────────────────╖
  3414. ║             Examples            ║
  3415. ╙─────────────────────────────────╜
  3416.  
  3417.     *  This mythical example shows how you could implement a journaling
  3418.     *  system to record changes to key tables.  Because the system
  3419.     *  date and time are retrieved directly from NetWare, they can
  3420.     *  be considered secure, and immune from tampering.
  3421.     *
  3422.     if updated()
  3423.         select journal
  3424.         replace date with N_ServDate(), time with N_ServTime(), user with;
  3425.             N_UserID(), action with 'modified record', key with partno
  3426.     endif
  3427.  
  3428.     ?N_ServDate()+5  && return date for 5 days from today.
  3429.  
  3430. ───────────────────────────────────
  3431.  
  3432. See Also:    N_SYSTime(), N_ServTime()
  3433.  
  3434. ───────────────────────────────────
  3435.  
  3436. ____________________________________________________________________________
  3437. N_ServDtch() - Detach from file server.
  3438.  
  3439. Description
  3440.  
  3441.     Detach from a specified file server.
  3442.  
  3443. Usage
  3444.  
  3445.     N_ServDtch( cServerName )
  3446.  
  3447.     cServerName is the name of the server to detach from.
  3448.  
  3449. Return Values
  3450.  
  3451.     .T. if successful, .F. otherwise.
  3452.  
  3453. Comments
  3454.  
  3455.     After detaching from a server, you must reset to a valid server using the N_DefServr() command.
  3456.  
  3457. ╓─────────────────────────────────╖
  3458. ║             Examples            ║
  3459. ╙─────────────────────────────────╜
  3460.     
  3461.     cServer=N_DefServr()
  3462.     =N_Login('JOEB',cPassWord,'ENGINEERING')
  3463.     if N_ServDtch('ENGINEERING')
  3464.         ?'connection to engineering server cleared'
  3465.     endif
  3466.     =N_DefServr(cServer)
  3467.     
  3468. ───────────────────────────────────
  3469.  
  3470. See Also:    N_Attached(), N_LogOff(), N_Login, N_ServAtch()
  3471.  
  3472. ───────────────────────────────────
  3473.  
  3474.  
  3475. ____________________________________________________________________________
  3476. N_Servers() - Create array with attached servers
  3477.  
  3478. Description
  3479.  
  3480.     The purpose of this function is to create an array that contains a list of all servers the current work-station is attached to.
  3481.  
  3482. Usage
  3483.  
  3484.     N_Servers( cArrayName [, .T. ] )
  3485.     
  3486.         cArrayName is the name of the array to store the server list into.
  3487.         
  3488.         If the optional second parameter of .T. is passed, the array created will be public.
  3489.  
  3490. Return Values
  3491.  
  3492.     Returns the number of servers the workstation is currently attached to.
  3493.  
  3494.  
  3495. ╓─────────────────────────────────╖
  3496. ║             Examples            ║
  3497. ╙─────────────────────────────────╜
  3498.  
  3499. =N_Servers('aServers')
  3500. external array aServers
  3501. create cursor Servers ( ServName c(48))
  3502. append from array aServers
  3503. go top
  3504. browse
  3505. use
  3506.  
  3507. ───────────────────────────────────
  3508.  
  3509. See Also:    N_GetSList(), N_Login(), N_LogOff(), N_ServAtch(), N_ServDtch()
  3510.  
  3511. ───────────────────────────────────
  3512.  
  3513. ____________________________________________________________________________
  3514. N_ServFrDr() - Return Server name.
  3515.  
  3516. Description
  3517.  
  3518.     Return the name of the file server that a drive is mapped to.
  3519.  
  3520. Usage
  3521.  
  3522.     N_ServFrDr( cDriveLetter )
  3523.  
  3524.     cDriveLetter is the drive letter to check.
  3525.  
  3526. Return Values
  3527.  
  3528.     Server name as character string.
  3529.  
  3530. ╓─────────────────────────────────╖
  3531. ║             Examples            ║
  3532. ╙─────────────────────────────────╜
  3533.  
  3534. ?N_ServFrDr('m')
  3535.     ENGINEERING
  3536.  
  3537. ───────────────────────────────────
  3538.  
  3539. See Also:    N_DrvPath(), N_MapDel(), N_MapDrive()
  3540.  
  3541. ───────────────────────────────────
  3542.  
  3543. ____________________________________________________________________________
  3544. N_ServTime() - Return File Server Time.
  3545.  
  3546. Description
  3547.  
  3548.     Return the current system time from the file server.
  3549.  
  3550. Usage
  3551.  
  3552.     N_ServTime()
  3553.  
  3554.  
  3555. Return Values
  3556.  
  3557.     Current server time as a formatted string.
  3558.  
  3559. ╓─────────────────────────────────╖
  3560. ║             Examples            ║
  3561. ╙─────────────────────────────────╜
  3562.  
  3563.     *  This mythical example shows how you could implement a journaling
  3564.     *  system to record changes to key tables.  Because the system
  3565.     *  date and time are retrieved directly from NetWare, they can safely
  3566.     *  be considered secure, and immune from tampering.
  3567.     *
  3568.     if updated()
  3569.         select journal
  3570.         replace date with N_ServDate(.t.), time with N_ServTime(), user with;
  3571.             N_UserID(), action with 'modified record', key with partno
  3572.     endif
  3573.  
  3574. ───────────────────────────────────
  3575.  
  3576. See Also:    N_SYSTime(), N_ServDate()
  3577.  
  3578. ───────────────────────────────────
  3579.  
  3580. ____________________________________________________________________________
  3581. N_ServVers() - Return NetWare server version number.
  3582.  
  3583. Description
  3584.  
  3585.     Return the NetWare version number for the default server.
  3586.  
  3587. Usage
  3588.  
  3589.     N_ServVers()
  3590.  
  3591. Return Values
  3592.  
  3593.     NetWare version number as a formatted string.
  3594.  
  3595. ╓─────────────────────────────────╖
  3596. ║             Examples            ║
  3597. ╙─────────────────────────────────╜
  3598.  
  3599. ?N_ServVers()
  3600.     3.11
  3601.  
  3602. ____________________________________________________________________________
  3603. N_SetAttr() - Set extended attributes of a file.
  3604.  
  3605. Description
  3606.  
  3607.     Set the extended attribute flags of a file on a NetWare file server.
  3608.  
  3609. Usage
  3610.  
  3611.     N_SetAttr( cFileSpec, cAttribs)
  3612.  
  3613.     cFileSpec is the file specification to process.  It may include the DOS wild-card characters * and ?.
  3614.  
  3615.     cAttribs are the attribute flags to modify.  The flags are set in the format +<attribute> or -<Attribute>.  Valid attribute flags are listed below.
  3616.  
  3617.  
  3618.                 H    Hidden
  3619.                 A    Archive
  3620.                 R    Read Only
  3621.                 Y    System
  3622.                 X    Execute Only
  3623.                 S    Shareable
  3624.                 T    Transactional
  3625.                 I    Indexed (NetWare 2.2 and lower)
  3626.  
  3627. Return Values
  3628.  
  3629.     Number of files that had their attributes modified.
  3630.     
  3631. Comments
  3632.  
  3633.     Do not flag compiled FoxPro .EXE files X (Execute only).  Because these files contain overlays, they must be able to be read.  Once a file is flagged execute only, the file cannot be read, copied, or unflagged.
  3634.  
  3635.     Once a file is marked Transactional, it cannot be deleted.  This also means that you cannot pack a DBF that is marked transactional.
  3636.  
  3637.     If you flag a DBF transactional, please make sure that you flag all associated files (FPT, CDX, IDX) Transactional also.
  3638.                 
  3639. ╓─────────────────────────────────╖
  3640. ║             Examples            ║
  3641. ╙─────────────────────────────────╜
  3642.  
  3643.     ?N_SetAttr('*.FXP','+S+R')
  3644.         97
  3645.  
  3646. ───────────────────────────────────
  3647.  
  3648. See Also:    N_DirInfo(), N_FileInfo()
  3649.  
  3650. ───────────────────────────────────
  3651.  
  3652. ____________________________________________________________________________
  3653. N_SetDots() - Read or set the value of SHOW DOTS in the network shell.
  3654.  
  3655. Description
  3656.  
  3657.     Read or set the value of SHOW DOTS for the station network shell.
  3658.  
  3659. Usage
  3660.  
  3661.     N_SetDots( [ lMode ] )
  3662.  
  3663.         If the optional parameter of lMode is passed then the setting of SHOW DOTS will be set to the specified mode.
  3664.  
  3665. Return Values
  3666.  
  3667.         Current setting of SHOW DOTS.
  3668.         
  3669. Comments
  3670.  
  3671.     This setting will affect how certain FoxPro functions work under NetWare.  For example, ADIR() will not ordinarily return . and .. directory entries.  If you set SHOW DOTS on, then it will.
  3672.  
  3673. ╓─────────────────────────────────╖
  3674. ║             Examples            ║
  3675. ╙─────────────────────────────────╜
  3676.  
  3677.     * Read the current value
  3678.     ?N_SetDots()
  3679.  
  3680.     * Set Show dots on
  3681.     ?N_SetDots(.T.)
  3682.  
  3683.     * Set Show dots off
  3684.     ?N_SetDots(.F.)
  3685.  
  3686.  
  3687. ____________________________________________________________________________
  3688. N_SetSem() - Perform NetWare semaphore locking.
  3689.  
  3690. Description
  3691.  
  3692.     Provide a system of using logical locks, with NetWare semaphores.
  3693.  
  3694. Usage
  3695.  
  3696.     N_SetSem( cSemaphoreName, lMode [, cServerName ])
  3697.  
  3698.     cSemaphoreName is the name of the semaphore to lock or unlock.
  3699.  
  3700.     If lMode is true, the semaphore is locked.  If lMode is .F., the semaphore is unlocked.
  3701.  
  3702.     cServerName is the optional server name where the semaphore should reside.
  3703.  
  3704. Return Values
  3705.  
  3706.     .T. if successful, .F. otherwise.
  3707.  
  3708. Comments
  3709.  
  3710.     NetWare Semaphores allow the programmer to perform logical record locking rather than physical record locking.  An example of this would be if you had multiple tables that you needed to update.  With semaphores, you could lock the primary key (in the example PartNo) and then proceed.  Using physical locks, it would be necessary to obtain locks on all the records in all the related tables in order to ensure that the transaction would be performed.  The only catch to this idea is that ALL APPLICATIONS WHICH UPDATE THOSE TABLES MUST CONSISTENTLY USE THE SEMAPHORE LOCKING, AND CONSISTENTLY NAME THOSE SEMAPHORES.
  3711.  
  3712.     It has been discussed in several books, and in several places, that although FoxPro can perform multiple locks in a DBF, an unlock command unlocks ALL records in that work area.  If, however, you were to implement locks using semaphores as a logical locking system, then you can indeed release one lock in that work area.
  3713.  
  3714. ╓─────────────────────────────────╖
  3715. ║             Examples            ║
  3716. ╙─────────────────────────────────╜
  3717.  
  3718.     If N_SetSem(Accounts.Acct_No, .T.)
  3719.         * Perform Edit of Account Master
  3720.         =N_SetSem(Accounts.Acct_no, .F. )
  3721.     else
  3722.         Wait Window 'Unable to obtain lock on record for '+Accounts.Acct_no
  3723.         return
  3724.     EndIf
  3725.  
  3726. ____________________________________________________________________________
  3727. N_ShellVer() - Return NetWare Shell Version
  3728.  
  3729. Description
  3730.  
  3731.     The purpose of this function is to return the NetWare Shell version.  If the NetWare shell is not loaded, this function will return a null string ("").
  3732.  
  3733. Usage
  3734.  
  3735.     N_ShellVer()
  3736.  
  3737. Return Values
  3738.  
  3739.     The NetWare Shell version in the format
  3740.  
  3741.         <Major Version>.<Minor Version><Rev> ( Shell Type )
  3742.  
  3743.         where Shell Type is:    N for NETx
  3744.                                 E for EMSNETx
  3745.                                 X for XMSNETx
  3746.  
  3747.  
  3748. ╓─────────────────────────────────╖
  3749. ║             Examples            ║
  3750. ╙─────────────────────────────────╜
  3751.  
  3752.     ?N_ShellVer()
  3753.         3.22A (E)  && EMSNETX Version 3.22A
  3754.  
  3755.     *  This next example shows how you could use N_Shellver() to
  3756.     *  test for presence of the Net Shell
  3757.  
  3758.     if empty(N_ShellVer())
  3759.         Wait Window "This machine does not have NETX loaded.  "+;
  3760.             "Program Cancelled..."
  3761.         cancel
  3762.     endif
  3763.  
  3764. ───────────────────────────────────
  3765.  
  3766. See Also:    N_LongMach(), N_ShrtMach()
  3767.  
  3768. ───────────────────────────────────
  3769.  
  3770. ____________________________________________________________________________
  3771. N_ShrtMach() - Return Short Machine Type
  3772.  
  3773. Description
  3774.  
  3775.     The purpose of this function is to return the short machine type of the executing station.
  3776.  
  3777. Usage
  3778.  
  3779.     N_ShrtMach()
  3780.  
  3781. Comments
  3782.  
  3783.     For information concerning machine types, refer to Novell's installation manuals.
  3784.  
  3785. ╓─────────────────────────────────╖
  3786. ║             Examples            ║
  3787. ╙─────────────────────────────────╜
  3788.  
  3789.     ?N_ShrtMach()
  3790.         IBM
  3791. ───────────────────────────────────
  3792.  
  3793. See Also:    N_LongMach(), N_ShellVer()
  3794.  
  3795. ───────────────────────────────────
  3796.  
  3797. ____________________________________________________________________________
  3798. N_Snd2Serv() - Broadcast a message to the server console
  3799.  
  3800. Description
  3801.  
  3802.     Send a message to the fileserver console.
  3803.  
  3804. Usage
  3805.  
  3806.     N_Snd2Serv( cMessage )
  3807.  
  3808.         cMessage is a character string holding the message.  This message may be up to 59 characters long.
  3809.  
  3810. Return Values
  3811.  
  3812.     0    -    Successful
  3813.     252    -    Message Queue Full
  3814.     254    -    I/O Failure; Lack of Dynamic Workspace
  3815.  
  3816. ╓─────────────────────────────────╖
  3817. ║             Examples            ║
  3818. ╙─────────────────────────────────╜
  3819.  
  3820.     ?N_Snd2Serv('Please mount CDROM volume')
  3821.  
  3822. ───────────────────────────────────
  3823.  
  3824. See Also:    N_MsgBrd(), N_MsgMode(), N_MsgRtrv()
  3825.  
  3826. ───────────────────────────────────
  3827.  
  3828.  
  3829. ____________________________________________________________________________
  3830. N_SndFServ() - Broadcast a message from the server console
  3831.  
  3832. Description
  3833.  
  3834.     Send a broadcast message to a specified user from the server console.
  3835.  
  3836. Usage
  3837.  
  3838.     N_SndFServ( cUserID, cMessage )
  3839.  
  3840.         cUserID is the user to send the message to.
  3841.  
  3842.         cMessage is a character string holding the message.  This message may be upto 55 characters long.
  3843.  
  3844. Comments
  3845.  
  3846.     There are differing levels that you can set the broadcast mode for a station.  It is possible to set the mode to ignore messages from other users, but accept messages from the server console.  Sending a message using this function will get the message through if the person has used N_CastMode to set the current broadcast mode to 1.
  3847.  
  3848. Return Values
  3849.  
  3850.     .T. if successful, .F. otherwise.
  3851.  
  3852. ╓─────────────────────────────────╖
  3853. ║             Examples            ║
  3854. ╙─────────────────────────────────╜
  3855.  
  3856.     ?N_SndFServ("Supervisor", 'Please mount CDROM volume')
  3857.  
  3858. ───────────────────────────────────
  3859.  
  3860. See Also:    N_ConsOper(), N_MsgBrd(), N_MsgMode(), N_MsgRtrv()
  3861.  
  3862. ───────────────────────────────────
  3863.  
  3864. ____________________________________________________________________________
  3865. N_StaAddr()  -  Return Physical station Address
  3866.  
  3867. Description
  3868.  
  3869.     Return the 12 digit physical node address of the specified station.  If no station is specified, return the address of the current station.
  3870.  
  3871. Usage
  3872.  
  3873.     N_StaAddr( [nStation] )
  3874.  
  3875.         nStation is the optional station number to get the network address for.
  3876.  
  3877.  
  3878.  
  3879. Return Values
  3880.  
  3881.     12 digit physical node address in hexadecimal
  3882.  
  3883. ╓─────────────────────────────────╖
  3884. ║             Examples            ║
  3885. ╙─────────────────────────────────╜
  3886.  
  3887.     ?N_StaAddr()
  3888.             0006EADF0003
  3889.  
  3890. ───────────────────────────────────
  3891.  
  3892. See Also:    N_ConnNum(), N_UserID()
  3893.  
  3894. ───────────────────────────────────
  3895.  
  3896. ____________________________________________________________________________
  3897. N_StPParms() - Set current capture settings.
  3898.  
  3899. Description
  3900.  
  3901.     The purpose of this function is to allow programs to modify their current NetWare capture settings.  This function allows programs to modify the FormFeed Flag, the notify flag, timeout functions, Setup and reset strings etc.
  3902.  
  3903.  
  3904. Usage
  3905.  
  3906.     N_StPParms( cArrayName, iLPTPort )
  3907.  
  3908.         cArrayName is the name of the array to read information from.  The array used to alter the settings is in the form listed below.
  3909.  
  3910.         iLPTPort is the LPT Port to set I.E. 1-3.
  3911.  
  3912.  
  3913.         Row            Contents
  3914.  
  3915.  
  3916.         1            Printer Setup Codes
  3917.         2            Printer Reset Codes
  3918.         3            Server Name
  3919.         4            Queue Name
  3920.         5            Form Number (0-255)
  3921.         6            Form Name
  3922.         7            Tab Size
  3923.         8            Tab Expansion ( .t. or .f. )
  3924.         9            Form Feed Flag ( .t. or .f. )
  3925.         10            Notification Flag ( .t. or .f. )
  3926.         11            AutoEndCap Flag ( .t. or .f. )
  3927.         12            Banner Text
  3928.         13            Banner Flag ( .t. or .f.)
  3929.         14            Number of Copies (1-255)
  3930.         15            Timeout in Seconds
  3931.  
  3932. Return Values
  3933.  
  3934.     NetWare completion code.
  3935.  
  3936.  
  3937. Comments
  3938.  
  3939.     The form name field is for information only, it is totally disregarded by NetWare.
  3940.  
  3941.     If you use form numbers, you must ensure that your customers understand forms, and more specifically how to inform NetWare that a form has been mounted.
  3942.  
  3943.     The Printer Setup Codes and Printer Reset Codes are fixed length fields.  When a station issues a capture with a J= parameter, these fields are where the setup and reset strings are stored.  The default values for the size of these two buffers is 64 and 16 bytes respectively.  If you wish to set aside a larger area for these buffers, you must put a setting in your SHELL.CFG file.  For more specific information, please refer to your NetWare Installation manual.
  3944.  
  3945.     Do not try to set the printer to a local printer by setting the 4th array element to null and calling N_StPParms().  To set the printer to local use N_CapMode() to toggle capture on or off.
  3946.  
  3947.     For an implementation of the Novell Job system, please refer to the SetPJob.PRG accompanying this program.
  3948.  
  3949.     Certain capture settings are ignored when using this function with FoxPro for Windows.  The number of copies is one example.  These problems arise because of how Windows handles printing.
  3950.  
  3951. ╓─────────────────────────────────╖
  3952. ║             Examples            ║
  3953. ╙─────────────────────────────────╜
  3954.  
  3955.     external array p_array
  3956.     =N_RdPParms('P_Array',1)        &&  Create our array with current settings
  3957.     P_Array[9]=.F.                    &&  Set Form Feed Off
  3958.     P_Array[1]=""                    &&    Null out setup & reset codes from last CAPTURE /J=
  3959.     P_Array[2]=""
  3960.     =N_StPParms('P_Array',1)        &&    Make changes active
  3961.  
  3962.  
  3963. ───────────────────────────────────
  3964.  
  3965. See Also:    N_CapMode(), N_FlushLPT(), N_RdPParms(), N_UserBnnr()
  3966.  
  3967. ───────────────────────────────────
  3968.  
  3969. ____________________________________________________________________________
  3970. N_SYSTime() - Synchronize the workstations clock with file server.
  3971.  
  3972. Description
  3973.  
  3974.     Synchronize the stations time and date with that on the file server.
  3975.  
  3976. Usage
  3977.  
  3978.     N_SYSTime( [ cServerName ] )
  3979.  
  3980.     cServerName is the optional server name to get the time from.
  3981.  
  3982. Comments
  3983.  
  3984.     This function is equivalent to running the Novell SYSTIME utility.  This function reads the date and time from the file server, and then sets the DOS date and time to the same value.  This function does not modify the value of the PCs internal real time clock.  If you have a lengthy application where you would like to ensure the date and time are valid, but don't wish to re-write the application to use N_ServDate(), and N_ServTime(), then placing this function at the head of your program should be adequate.  Bear in mind that if your program offers any sort of shell capability that users could change the clock using it.  You might want to set your program so that N_SYSTIME() is executed after every shell command.
  3985.  
  3986.     Generally, the worst case inaccuracy for this function is -2 seconds.  This inaccuracy is due to 2 reasons.  1) NetWare only returns the server's time with resolution of 1 second.  2)  The travel time from the server  to the workstation is unknown, but assumed to be between 0 and 1 second (on a 386/25 PC, a FOR..NEXT loop executing this function took 3.25 seconds for 1000 iterations).  So, we have a possible loss of .99 seconds because of the limited resolution in the NetWare time service, and an estimated loss of between 0 and 1 second for travel time from the server to the station, and some odd processing time.  If you were performing this call to a server linked by a WAN or MAN, your transit time for the packet may vary.  The result of all this reading and testing is: if you run this function against a local server, your PCs clock will, on average, be within .5 seconds of the server's time.
  3987.  
  3988.     If you are looking for an accurate source to set the clock on your server to, you may wish to try (303) 499-7111.  This is the number for the Atomic Clock located at the National Institute of Standards and Technology (Formerly NBS), located in Boulder, CO.
  3989.  
  3990. Return Values
  3991.  
  3992.     .T. always.
  3993.  
  3994. ╓─────────────────────────────────╖
  3995. ║             Examples            ║
  3996. ╙─────────────────────────────────╜
  3997.  
  3998.     =N_Systime()  && Station date & time are now synched with server.
  3999.  
  4000.  
  4001.     =N_SysTime('ENGINEERING')  && Synch clock to engineerings server.
  4002.  
  4003. ───────────────────────────────────
  4004.  
  4005. See Also:    N_ServDate(), N_ServTime()
  4006.  
  4007. ───────────────────────────────────
  4008.  
  4009. ____________________________________________________________________________
  4010. N_TrustLst()    -    Create a trustee list for a directory.
  4011.  
  4012. Description
  4013.  
  4014.     The purpose of this function is to create an array containing a list of trustees for a specified file or directory.
  4015.  
  4016. Usage
  4017.  
  4018.     N_TrustLst( cArrayName, cPath [, cServer, lPublic])
  4019.     
  4020.         cArrayName is the name of the array to create.
  4021.         
  4022.         cPath is the path or file name to return the trustee list for.  cPath must be in the form <VOLUME>:<PATH>\<NAME>.
  4023.         
  4024.         cServer is the optional parameter specifying what server the file resides on.  If this parameter is not passed, the default server is assumed.
  4025.  
  4026.         lPublic is an optional parameter specifying whether the array to be created should be public or private.  If lPublic is passed, and .T., the the array created will be public.
  4027.  
  4028. Return Values
  4029.  
  4030.         Creates a two dimensional array where column 1 is the object name and column 2 is the object type, and column 3 is the rights mask for the object.  Returns as an integer the number of trustees found.
  4031.  
  4032.         If the directory does not exist, you do not have rights to that directory, or there are no trustees, the function returns 0.
  4033.  
  4034.         If an error occurs, the function returns the NetWare Error code as a negative number.  Error codes are:
  4035.  
  4036.             -152    Volume Does Not Exist
  4037.  
  4038. Comments:
  4039.  
  4040.     This function works only on NetWare 3.11 and higher.
  4041.     
  4042. ╓─────────────────────────────────╖
  4043. ║             Examples            ║
  4044. ╙─────────────────────────────────╜
  4045. ───────────────────────────────────
  4046.  
  4047. See Also:    N_TrustMod(), N_TrustRem()
  4048.  
  4049. ───────────────────────────────────
  4050.  
  4051.  
  4052. ____________________________________________________________________________
  4053. N_TrustMod()    -    Modify the trustee rights for a user or group.
  4054.  
  4055. Description
  4056.  
  4057.     The purpose of this function is to modify the trustee rights for a user or group for a specified file or directory.
  4058.  
  4059. Usage
  4060.  
  4061.     N_TrustMod( cPath, cFlags, cObject [,iObjectType, cServer] )
  4062.     
  4063.         cPath is the file or directory name to change trustee rights for.  cPath must be in the format <VOLUME>:<PATH>\<NAME>.
  4064.  
  4065.         cFlags are the new permissions to assign to the directory or path.  Allowed flags are:
  4066.  
  4067.                 R        Read
  4068.                 W        Write
  4069.                 C        Create
  4070.                 E        Erase
  4071.                 A        Access Control
  4072.                 F        File Scan
  4073.                 M        Modify
  4074.                 S        Supervisory
  4075.                 
  4076.                 N        Normal (All rights but A and S)
  4077.                 ALL        All rights
  4078.  
  4079.  
  4080.         iObjectType is an optional parameter specifying object type.  The default value is 1 (USER).  Allowed values are:
  4081.  
  4082.             1    User
  4083.             2    User Group
  4084.             
  4085.         cServer is the optional server where the file resides.  If this parameter is not passed, the default server is assumed.    
  4086.  
  4087. Return Values
  4088.  
  4089.               0        Success
  4090.             152        Volume Does Not Exist
  4091.             156        Path or File Does Not Exist
  4092.             255        No Rights To Modify Trustee
  4093.  
  4094. Comments
  4095.  
  4096.     This function only works on NetWare 3.11 and higher.
  4097.  
  4098.     In order to use this function, you must have ACCESS control rights to the directory or file you specify.
  4099.  
  4100.     Rights granted to a file apply only to that instance of the file.  For example, if you grant rights to a file, and then pack the file, all users will lose rights to the packed file.  This is because the packed file is actually a new directory entry.
  4101.  
  4102. ╓─────────────────────────────────╖
  4103. ║             Examples            ║
  4104. ╙─────────────────────────────────╜
  4105.  
  4106. use ACCOUNTS
  4107. PACK
  4108. USE
  4109. * Grant read rights to group everyone for the accounts table
  4110. =N_TrustMod(DOSTONET('ACCOUNTS.DBF'),'RF','EVERYONE',2)
  4111.  
  4112. * Grant rights to my user directory to another user
  4113. * on the engineering server
  4114. =N_TrustMod('SYS:USERS\'+N_UserID(),'ALL','CAROL',1, 'ENGINEERING')
  4115.  
  4116. * Grant the same rights on the default server
  4117. =N_TrustMod('SYS:USERS\'+N_UserID(),'ALL','CAROL')
  4118.  
  4119. ───────────────────────────────────
  4120.  
  4121. See Also:    N_TrustLst(), N_TrustRem()
  4122.  
  4123. ───────────────────────────────────
  4124.  
  4125. ____________________________________________________________________________
  4126. N_TrustRem()    -    Remove a trustee from the specified path or file.
  4127.  
  4128. Description
  4129.  
  4130.     The purpose of this function is to remove a trustee from the specified path or file.
  4131.     
  4132. Usage
  4133.  
  4134.     N_TrustRem( cPath, cObject [, iObjectType, cServer] )
  4135.  
  4136.  
  4137.         cPath is the file or directory name to remove the trustee from.  The name must be in the format <VOLUME>:<PATH> or <VOLUME>:<PATH>\<NAME>.
  4138.  
  4139.         cObject is the name of the user or group to remove trusteeship for.
  4140.         
  4141.         iObjectType is an optional parameter that specifies the type of object you are dealing with.  Allowed values are 1 USER and 2 USER GROUP.
  4142.  
  4143.         cServer is the optional server name the file or directory resides on.  If this parameter is not passed, the default server is assumed.
  4144.  
  4145. Return Values
  4146.  
  4147.     .T. if successful, .F. otherwise.
  4148.  
  4149. Comments
  4150.  
  4151.     You must have the ACCESS control privilege for the specified directory.
  4152.     
  4153. ╓─────────────────────────────────╖
  4154. ║             Examples            ║
  4155. ╙─────────────────────────────────╜
  4156.  
  4157. * Revoke group everyone's rights to accounts table
  4158. * on engineering server
  4159. =N_TrustRem(dostonet('ACCOUNTS.DBF'),'EVERYONE',2, 'ENGINEERING')
  4160.  
  4161. * Revoke directory rights from a user for my directory
  4162. =N_TrustRem('SYS:USERS\'+N_UserID(),'CAROL')
  4163.  
  4164. * Revoke directory rights from a user for my directory on
  4165. * engineering's server
  4166. =N_TrustRem('SYS:USERS\'+N_UserID(),'CAROL', 1, 'ENGINEERING')
  4167.  
  4168. ───────────────────────────────────
  4169.  
  4170. See Also:    N_TrustLst(), N_TrustMod()
  4171.  
  4172. ───────────────────────────────────
  4173.  
  4174.  
  4175. ____________________________________________________________________________
  4176. N_TTSAvail() - Return/Set TTS Availability
  4177.  
  4178. Description
  4179.  
  4180.     The purpose of this function is to return or set the availability of TTS on a server.  Used with no parameter, the function returns if TTS is available.  Used with a parameter, it turns TTS on or off.
  4181.  
  4182. Usage
  4183.  
  4184.     N_TTSAvail( [lAvailable] )
  4185.  
  4186.         If the optional parameter lAvailable is .T., TTS is enabled.  If lAvailable is .F., TTS is disabled.
  4187.  
  4188. Return Values
  4189.  
  4190.     If no parameter is passed, the function returns .T. if TTS is available, and .F. if it is not.
  4191.  
  4192.     If a parameter is passed, the function returns .T. if the status was changed, .F. otherwise.
  4193.  
  4194. Comments
  4195.  
  4196.     To use the set feature of this function, the person logged in must be a console operator.
  4197.  
  4198. ╓─────────────────────────────────╖
  4199. ║             Examples            ║
  4200. ╙─────────────────────────────────╜
  4201.  
  4202. * Query current TTS status
  4203. ?N_TTSAvail()
  4204.     .T.
  4205.  
  4206. * Disable TTS
  4207. ?N_TTSAvail(.f.)    && Assumes I am a console operator
  4208.     .T.
  4209.  
  4210. * Enable TTS
  4211. ?N_TTSAvail(.T.)
  4212.     .T.
  4213. ───────────────────────────────────
  4214.  
  4215. See Also:    N_SetAttr(), N_TTSBegin(), N_TTSCommt(), N_TTSRollB(), N_TTSStat()
  4216.  
  4217. ───────────────────────────────────
  4218.  
  4219. ____________________________________________________________________________
  4220. N_TTSBegin() - Begin an explicit transaction
  4221.  
  4222. Description
  4223.  
  4224.     The purpose of this function is to signal to the NetWare operating system that an explicit TTS transaction has begun.
  4225.  
  4226. Usage
  4227.  
  4228.     N_TTSBegin()
  4229.  
  4230.  
  4231. Return Values
  4232.  
  4233.     NetWare completion code:
  4234.  
  4235.         0        Success
  4236.         150        Out of Dynamic Workspace
  4237.         254        Implicit Transaction Already Active.  Implicit transactions will be converted to explicit transactions
  4238.         255        Explicit Transaction Already Active.  Existing transaction will continue normally.
  4239.  
  4240. Comments
  4241.  
  4242.     There are some very serious pitfalls to be aware of when using TTS with FoxPro and NetWare.  Generally speaking, TTS is only recommended for non-interactive batch update processes.  Some of the problems with TTS are:
  4243.  
  4244.         If you issue an APPEND BLANK or INSERT INTO command while a TTS Transaction is active, the DBF header will be locked until the transaction is committed or rolled back.  When you issue an append, the record count located in the first 32 bytes of the header is modified.  This means that no other users may issue an APPEND BLANK or even issue a USE <DBFName> until the transaction is committed.
  4245.  
  4246.         Records locked during a TTS transaction remain locked until the transaction is committed or rolled back.  This lock, unlike a normal FoxPro lock, prevents other users from examining affected records.
  4247.  
  4248.         If the changes haven't been written to disk, then a roll-back will not work.  For example:
  4249.  
  4250.             use test
  4251.             =N_TTSBegin()
  4252.             append blank
  4253.             replace field1 with 1
  4254.             =N_TTSRollB()
  4255.             use
  4256.         
  4257.         will not always have the expected outcome.  Because the changes haven't been written to disk yet by FoxPro, Novell can't roll them back.  To work around this problem, you should issue a FLUSH command before any RollBack commands.
  4258.  
  4259.         There is a real limit to how large your transaction can be.  Under NetWare 3.11, the maximum number of record locks per connection is 10,000.  Thus, the theoretical maximum number of locks in a single transaction is 10,000.  In reality, the number will depend upon your server's available memory and disk space.  It is recommended by Novell that you perform updates on a small number of records in each transaction.
  4260.  
  4261. ╓─────────────────────────────────╖
  4262. ║             Examples            ║
  4263. ╙─────────────────────────────────╜
  4264. private nTransNo
  4265. if N_TTSAvail() and N_SetAttr('TEST.DBF')
  4266.     use test
  4267.     =N_TTSBegin()                && Start the transaction
  4268.     browse                        && Make our changes
  4269.     FLUSH
  4270.     if yes('Write changes to disk?')
  4271.         nTransNo=N_TTSCommt()    && Get the transaction number
  4272.         *
  4273.         *    Now wait until we are sure changes are written by the NetWare OS.
  4274.         *
  4275.         do while not N_TTSStat(nTransNo)
  4276.             =inkey(.5)
  4277.         enddo
  4278.         =MsgWin('Transaction written to disk!')
  4279.     else
  4280.         =N_TTSRollB()
  4281.         =MsgWin('Transaction rolled back!')
  4282.     endif
  4283.     use
  4284. else
  4285.     =MsgWin('TTS was not available!')
  4286. endif
  4287. ───────────────────────────────────
  4288.  
  4289. See Also:    N_SetAttr(), N_TTSAvail(), N_TTSCommt(), N_TTSRollB(), N_TTSStat()
  4290.  
  4291. ───────────────────────────────────
  4292.  
  4293. ____________________________________________________________________________
  4294. N_TTSCommt() - Signal the end of an explict TTS Transaction
  4295.  
  4296. Description
  4297.  
  4298.     Signal the end of an explicit TTS transaction.
  4299.  
  4300. Usage
  4301.  
  4302.     N_TTSCommt()
  4303.  
  4304. Return Values
  4305.  
  4306.     Transaction number.  This transaction number can be used by N_TTSStat() to verify the transaction has been written.
  4307.  
  4308. Comments
  4309.  
  4310.     Depending upon the load on your server, and it's various settings, up to 10 seconds can pass before a transaction can be written.
  4311.  
  4312. ───────────────────────────────────
  4313.  
  4314. See Also:    N_SetAttr(), N_TTSAvail(), N_TTSBegin(), N_TTSRollB(), N_TTSStat()
  4315.  
  4316. ───────────────────────────────────
  4317.  
  4318. ____________________________________________________________________________
  4319. N_TTSRollB() - Roll back an explicit TTS transaction
  4320.  
  4321. Description
  4322.  
  4323.     Roll back an explicit NetWare TTS transaction.
  4324.  
  4325. Usage
  4326.  
  4327.     N_TTSRollB()
  4328.  
  4329. Return Values
  4330.  
  4331.     NetWare completion code.
  4332.  
  4333.         0        Success
  4334.         253        Transaction Tracking Disabled (No Rollback performed)
  4335.         254        Transaction Ended, records locked
  4336.         255        No Explicit Transaction Active
  4337.  
  4338.  
  4339. ───────────────────────────────────
  4340.  
  4341. See Also:    N_SetAttr(), N_TTSAvail(), N_TTSBegin(), N_TTSCommt(), N_TTSStat()
  4342.  
  4343. ───────────────────────────────────
  4344.  
  4345. ____________________________________________________________________________
  4346. N_TTSStat() - Return status of an ended transaction
  4347.  
  4348. Description
  4349.  
  4350.     The purpose of this function is to return the status of a completed TTS Transaction.
  4351.  
  4352.  
  4353. Usage
  4354.  
  4355.     N_TTSStat( nTransNo )
  4356.  
  4357.         nTransNo is the transaction number returned by N_TTSCommt()
  4358.  
  4359. Return Values
  4360.  
  4361.     .T. if the transaction has been written to disk, .F. otherwise.
  4362.  
  4363.  
  4364. ───────────────────────────────────
  4365.  
  4366. See Also:    N_SetAttr(), N_TTSAvail(), N_TTSBegin(), N_TTSCommt(), N_TTSRollB()
  4367.  
  4368. ───────────────────────────────────
  4369.  
  4370. ____________________________________________________________________________
  4371. N_UserBnnr() - Read/Set user name for banner page
  4372.  
  4373. Description
  4374.  
  4375.     Read/Set the user name printed on the banner page of a print job.
  4376.  
  4377. Usage
  4378.  
  4379.     N_UserBnnr( [ cUserName ] )
  4380.  
  4381.     If the optional parameter cUserName is not passed, then the function will return the current user-name printed on the banner.
  4382.  
  4383.     If the optional parameter cUserName is passed then the function will set the user-name printed on the banner to that value.  Only the first 12 characters of the passed name will be used.
  4384.  
  4385. Return Values
  4386.  
  4387.     User-name that will be printed on the banner page.
  4388.  
  4389. Comments
  4390.  
  4391.     When you capture using Novell's CAPTURE command, it sets the banner user-name.  If a user logs into a station and then capture is initiated using another method (N_StPParms() for example), then the user-name stored by the work-station shell will not be updated.  This command provides a method of working around this problem.
  4392.  
  4393. ───────────────────────────────────
  4394.  
  4395. See Also:    N_RdPParms(), N_StPParms()
  4396.  
  4397. ───────────────────────────────────
  4398.  
  4399.  
  4400. ____________________________________________________________________________
  4401. N_UserID() - Return NetWare User ID
  4402.  
  4403. Description
  4404.  
  4405.     Return the NetWare user id of the a station.  If the station is not logged in, the function returns a null string.
  4406.  
  4407. Usage
  4408.  
  4409.     N_UserID( [iStationNumber] )
  4410.  
  4411.     iStationNumber is the optional station number to retrieve the Login ID for.  If this parameter is ommitted, the Login ID of the person on the executing station will be returned.
  4412.  
  4413. ╓─────────────────────────────────╖
  4414. ║             Examples            ║
  4415. ╙─────────────────────────────────╜
  4416.  
  4417. Set Library to GPLIB
  4418. use Journal
  4419. Append Blank
  4420. Replace User_ID with N_UserID(), Date with ;
  4421.     N_ServDate(), Action with "Added record to personnel file."
  4422. select Personnel
  4423. Append Blank
  4424. Edit
  4425. Close Data
  4426.  
  4427.  
  4428. *
  4429. *    The second example demonstrates a user list function
  4430. *
  4431.  
  4432. Private nMaxConns, nWorkArea
  4433. nWorkArea=select()
  4434. nMaxConns=N_MaxConns()
  4435. Create cursor Logged (;
  4436.     Station n(4,0), ;
  4437.     UserID c(30), ;
  4438.     Fullname c(40), ;
  4439.     LogDate d(8),;
  4440.     LogTime c(8), ;
  4441.     address c(12))
  4442. for n=1 to nMaxConns+2
  4443.     if len(N_UserID(n))>0
  4444.         append blank
  4445.         replace ;
  4446.             Station with n,;
  4447.             UserId with N_UserID(n),;
  4448.             Fullname with N_UserName(n),;
  4449.             LogDate with N_LogInfo(n,1),;
  4450.             LogTime with n_LogInfo(n,2), ;
  4451.             address with n_StaAddr(n)
  4452.     endif
  4453. endfor
  4454. go top
  4455. browse fields Station :H='#' :4,;
  4456.     UserID :H='User ID' :15,;
  4457.     Fullname :H='Full Name' :40,;
  4458.     LogDate :H='Login Date',;
  4459.     LogTime :H='Login Time',;
  4460.     Address :H='Address';
  4461.     title 'Users Currently Logged In' ;
  4462.     last noappend nodelete nomodify
  4463. use
  4464. select (nWorkArea)
  4465. ───────────────────────────────────
  4466.  
  4467. See Also:    N_LogInfo(), N_UserName()
  4468.  
  4469. ───────────────────────────────────
  4470.  
  4471. ____________________________________________________________________________
  4472. N_UserName() - Return full name of a specified user or station.
  4473.  
  4474. Description
  4475.  
  4476.     Return the full user name for the connection number specified.  If no connection number is specified, the full name for the user logged in on the executing machine is returned.  Optionally, you may specify the character name of a USER OBJECT only, and get the full name.  At this time, you cannot specify the character name for a Print Server, or other object.
  4477.  
  4478. Usage
  4479.  
  4480.     N_UserName( iStationNumber | cLoginID )
  4481.  
  4482.     iStationNumber is the optional station number to get the name for.
  4483.  
  4484.     cLoginID is the optional name of the LoginID to get the name for.
  4485.  
  4486. Return Values
  4487.  
  4488.     Full name as entered in the NetWare bindery.  If no full name is specified the function returns < (OBJECT TYPE) - No Full Name >.
  4489.  
  4490. ╓─────────────────────────────────╖
  4491. ║             Examples            ║
  4492. ╙─────────────────────────────────╜
  4493.  
  4494.     ?N_UserName(2)
  4495.         Bill Smith
  4496.  
  4497.     ?N_UserName('BillS')
  4498.         Bill Stanley, x2322
  4499.  
  4500.     ?N_UserName(3)
  4501.         < User - No Full Name >
  4502.  
  4503. *  Display a list of users currently logged in, and their full names
  4504. Max_Conns=N_MaxConns()
  4505. for loop=1 to Max_Conns
  4506.     if len(N_UserID(loop))>0
  4507.         ?str(loop,3), PADR(N_UserID(loop),12),padr(N_UserName(loop),40),n_LogInfo(loop,1), N_LogInfo(loop,2)
  4508.     endif
  4509. endfor
  4510.  
  4511. ───────────────────────────────────
  4512.  
  4513. See Also:    N_AcctList(), N_UserID()
  4514.  
  4515. ───────────────────────────────────
  4516.  
  4517. ____________________________________________________________________________
  4518. N_VerPwd() - Verify a users password
  4519.  
  4520. Description
  4521.  
  4522.     The purpose of this function is to verify a user's network password.  Using this function, a programmer can force a user to reenter his network password before entry into an application.  This simplifies network & application administration, by not requiring multiple passwords for applications.  An additional benefit of this method is the users password stays stored in the bindery.  Using this procedure provides an additional layer of security in case your users leave their computers logged in at a system menu.
  4523.  
  4524. Usage
  4525.  
  4526.     N_VerPwd( cPassWord )
  4527.  
  4528.     cPassWord is the user's Novell NetWare password.
  4529.  
  4530. Return Values
  4531.  
  4532.         0    -    Successful (Password Correct)
  4533.       197    -    Account Locked By Intruder Lockout Detection
  4534.       240    -    Wildcard Not Allowed
  4535.       251    -    No Such Property
  4536.       252    -    No Such Object
  4537.       254    -    Server Bindery Locked
  4538.       255    -    Failure (No such object or bad password)
  4539.  
  4540. Comments
  4541.  
  4542.     If your network has intruder detection lockout turned on, and a call is made to this routine unsuccessfully <N> times, the account for that user will be locked.
  4543.  
  4544. ╓─────────────────────────────────╖
  4545. ║             Examples            ║
  4546. ╙─────────────────────────────────╜
  4547.  
  4548.     Store space(127) to PassWord
  4549.     @5,5 Say 'Please enter password for entry to payroll files ' Get PassWord Picture "@S40"
  4550.     Read
  4551.     PassWord=Alltrim(PassWord)
  4552.     if N_VerPwd(PassWord)<>0
  4553.         WAIT WINDOW 'Error Access Denied!'
  4554.         CANCEL
  4555.     endif
  4556.     *  Main application for payroll
  4557.  
  4558. ───────────────────────────────────
  4559.  
  4560. See Also:    N_ChgPwd(), N_MemberOf(), N_SecEquiv()
  4561.  
  4562. ───────────────────────────────────
  4563.  
  4564. ____________________________________________________________________________
  4565. N_Volumes() - Create array containing mounted volumes on server.
  4566.  
  4567. Description
  4568.  
  4569.     The purpose of this function is to create an array containing a list of mounted volumes on a NetWare file server.
  4570.  
  4571. Usage
  4572.  
  4573.     N_Volumes( cArrayName [, cServerName , .T. ])
  4574.  
  4575.         cArrayName is the name of the array to create.
  4576.  
  4577.         cServerName is the optional server name to get the list from.
  4578.  
  4579.         If the optional parameter of .T. is included, the array will be
  4580.         created as a public array.
  4581.  
  4582. Return Values
  4583.  
  4584.     Number of volumes mounted on server.
  4585.  
  4586. ╓─────────────────────────────────╖
  4587. ║             Examples            ║
  4588. ╙─────────────────────────────────╜
  4589.  
  4590.     ?N_Volumes('TEST')
  4591.         2
  4592.     disp memory like test
  4593.         test[1]        "SYS"
  4594.         test[2]        "USERS"
  4595.  
  4596.  
  4597. ───────────────────────────────────
  4598.  
  4599. See Also:    N_DirInfo()
  4600.  
  4601. ───────────────────────────────────
  4602.  
  4603.  
  4604. ____________________________________________________________________________
  4605. Num_Serial() - Return Number of Serial Ports
  4606.  
  4607. Description
  4608.  
  4609.     Return the number of serial ports installed in a machine.  This can be useful in developing machine inventory programs in FoxPro.
  4610.  
  4611. Usage
  4612.  
  4613.     Num_Serial()
  4614.  
  4615. Return Values
  4616.  
  4617.     Number of serial ports installed on machine.
  4618.  
  4619. Comments
  4620.  
  4621.     This function operates by calling the BIOS function GetEquipmentList(), and returning the number of serial ports the BIOS reports.
  4622.  
  4623. ───────────────────────────────────
  4624.  
  4625. See Also:    Math_Chip()
  4626.  
  4627. ───────────────────────────────────
  4628.  
  4629. ____________________________________________________________________________
  4630. Rem_Dir() - Remove a directory
  4631.  
  4632. Description
  4633.  
  4634.     Remove a DOS directory
  4635.  
  4636. Usage
  4637.  
  4638.     Rem_Dir( cDirName )
  4639.  
  4640.         cDirName is the directory name to remove.
  4641.  
  4642. Return Values
  4643.  
  4644.     .T. if successful, .F. otherwise.
  4645.  
  4646. Comments
  4647.  
  4648.     Normal DOS limitations about removing directories also apply to this function.  I.E. the directory you remove must be empty.
  4649.  
  4650.  
  4651. ╓─────────────────────────────────╖
  4652. ║             Examples            ║
  4653. ╙─────────────────────────────────╜
  4654.  
  4655.     ?REM_DIR('C:\TEMP\TEMP1')
  4656.         .T.
  4657.  
  4658.  
  4659. ───────────────────────────────────
  4660.  
  4661. See Also:    Make_Dir()
  4662.  
  4663. ───────────────────────────────────
  4664.  
  4665. ____________________________________________________________________________
  4666. SetMLimit() - Set Mouse Limits
  4667.  
  4668. Description
  4669.  
  4670.     The purpose of this function is to set the limits of travel for the mouse cursor.  An example of this would be creating a message window and restricting the mouse cursor to the inside of the window.
  4671.  
  4672. Usage
  4673.  
  4674.     SetMLimit( iY1, iX1, iY2, iX2 )
  4675.  
  4676.         iY1 is the upper Y Limit
  4677.  
  4678.         iX1 is the left X Limit
  4679.  
  4680.         iY2 is the lower Y Limit
  4681.  
  4682.         iX2 is the right x Limit
  4683.  
  4684. Comments
  4685.  
  4686.     This function only works in FoxPro DOS.  A call to this function in FoxPro for Windows will be ignored.  You might want to use the SCOLS(), and SROWS() function to reset mouse limits.  This will allow the program to work in any display mode for FoxPro.
  4687.  
  4688.         I.E. SETMLIMIT(0,0,Srows()-1, SCOls()-1)
  4689.  
  4690. Return Values
  4691.  
  4692.     .T.
  4693.  
  4694.  
  4695.  
  4696. ───────────────────────────────────
  4697.  
  4698. See Also:    MReset(), SetMPos()
  4699.  
  4700. ───────────────────────────────────
  4701.  
  4702. ____________________________________________________________________________
  4703. SetMPos() - Set Mouse Cursor Position
  4704.  
  4705. Description
  4706.  
  4707.     Set the mouse cursor position on the screen.
  4708.  
  4709. Usage
  4710.  
  4711.     SETMPOS( iY, iX )
  4712.  
  4713.         iY is the Y axis coordinate
  4714.  
  4715.         iX is the X axis coordinate
  4716.  
  4717. Return Values
  4718.  
  4719.     .T.
  4720.  
  4721. Comments
  4722.  
  4723.     This function only works in FoxPro DOS.  A call to this function in FoxPro for Windows will be ignored.
  4724.  
  4725.  
  4726. ╓─────────────────────────────────╖
  4727. ║             Examples            ║
  4728. ╙─────────────────────────────────╜
  4729.  
  4730.     *  Issue Push Button @ Says
  4731.     =SetMPos(10,10)
  4732.     Read  && The mouse character is now on the OK button
  4733.  
  4734. ───────────────────────────────────
  4735.  
  4736. See Also:    MReset(), SetMPos()
  4737.  
  4738. ───────────────────────────────────
  4739.  
  4740. ____________________________________________________________________________
  4741. ShftPrtScr() - Invoke hardeare interrupt 5 to perform a Shift-Printscreen
  4742.  
  4743. Description
  4744.  
  4745.     Invoke hardware interrupt 5 to perform a Shift-Printscreen
  4746.  
  4747. Usage
  4748.  
  4749.     ShftPrtScr()
  4750.  
  4751. Return Values
  4752.  
  4753.     .T. always.
  4754.  
  4755. ____________________________________________________________________________
  4756. TrimLen() - Return Trimmed Length of a String
  4757.  
  4758. Description
  4759.  
  4760.     The purpose of this function is to return the LEN of an ALLTRIM'd string.  It is functionally equivalent to LEN(ALLTRIM(string)).
  4761.  
  4762. Usage
  4763.  
  4764.     TrimLen( expC )
  4765.  
  4766.     ExpC is the character expression to check.
  4767.  
  4768. ╓─────────────────────────────────╖
  4769. ║             Examples            ║
  4770. ╙─────────────────────────────────╜
  4771.  
  4772.     if TrimLen(MyUserInput)=0
  4773.         return
  4774.     else
  4775.         * process input
  4776.     endif
  4777.  
  4778. ____________________________________________________________________________
  4779. UniqueName() - Return unique file name
  4780.  
  4781. Description
  4782.  
  4783.     The purpose of this function is to return a unique file name.  This function requires that the machine be operating on a Novell Network.
  4784.  
  4785. Usage
  4786.  
  4787.     UniqueName()
  4788.  
  4789. Return Values
  4790.  
  4791.     A unique file name which consists of:
  4792.  
  4793.         '$T' + Network Station Number in Hex + a sequential number starting at 1, and returned in hexadecimal.
  4794.  
  4795. Comments
  4796.  
  4797.     Fox's SYS(3) purports to return a unique file name, but it actually returns a random file name.  Because this function incorporates the NetWare station number in it's result, it is a guaranteed unique file name.
  4798.  
  4799. ╓─────────────────────────────────╖
  4800. ║             Examples            ║
  4801. ╙─────────────────────────────────╜
  4802.  
  4803.     Use MyFile
  4804.     Scratch=UniqueName()
  4805.     Copy Structure to (Scratch)
  4806.     use (scratch) exclusive alias scratch
  4807.     *  perform processing
  4808.     use
  4809.     erase (scratch+'.dbf')
  4810.  
  4811.     *  Example 2
  4812.     ?UniqueName()    && logged in on NetWare station #97
  4813.         $T610001
  4814.     ?UniqueName()
  4815.         $T610002
  4816.  
  4817.