home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / PBAPI10.ZIP / APIDOCS.ZIP / NETWORK.DOC < prev    next >
Text File  |  1998-02-21  |  5KB  |  112 lines

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. NETWORK_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The NETWORK_DAT unit is used to manipulate data in the NETWORK.DAT data file
  8. found in node 1's MWORK directory. The NETWORK_DAT unit is declared in
  9. PBAPI10.INC as follows:
  10.  
  11.  File Name: Main Type Structure for "NETWORK.DAT" file
  12.  
  13. TYPE NETWORK
  14.   NetworkName      AS STRING * 41
  15.   ReservedDataArea AS STRING * 215
  16. END TYPE
  17.  
  18. DIM NETWORK AS SHARED NETWORK
  19. DIM netwk   AS SHARED NETWORK PTR
  20.  
  21. netwk = VARPTR32(NETWORK)
  22. LSET NETWORK = NETWORK   
  23. ---------------------------------------------------------------------------
  24.  
  25. FUNCTION's below are from the NETWORK.PBU Unit and DECLAREd in PBAPI10.INC.
  26.  
  27. FUNCTION NETWORK_DAT_OPEN()
  28. FUNCTION NETWORK_DAT_CLOSE()
  29. FUNCTION NETWORK_DAT_READ(n AS INTEGER)
  30. FUNCTION NETWORK_DAT_WRITE(n AS INTEGER)
  31. FUNCTION NETWORK_DAT_Length() AS LONG
  32. FUNCTION NETWORK_DAT_OpenRead(n AS INTEGER)
  33. FUNCTION NETWORK_DAT_WriteClose(n AS INTEGER)
  34. FUNCTION NETWORK_DAT_OpenReadClose(n AS INTEGER)
  35. FUNCTION NETWORK_DAT_OpenWriteClose(n AS INTEGER)
  36. FUNCTION NETWORK_DAT_Clearit(n AS INTEGER)
  37.  
  38. FUNCTION NETWORK_DAT_GetNWN() AS STRING
  39. FUNCTION NETWORK_DAT_PutNWN(s AS STRING)
  40.  
  41. ---------------------------------------------------------------------------
  42. IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
  43.            before calling to any Function with the "OPEN" command in it. 
  44.  
  45. NETWORK_DAT_Open
  46.  The NETWORK_DAT_Open Function opens the NETWORK.DAT data file in node 1's
  47.  MWORK directory.
  48.  
  49. NETWORK_DAT_Close
  50.  The NETWORK_DAT_Close Function closes the NETWORK.DAT data file in node 1's
  51.  MWORK directory.
  52.  
  53. NETWORK_DAT_Read(n AS INTEGER)
  54.  The NETWORK_DAT_Read Function reads the record for message conference "n"
  55.  into memory.
  56.  
  57. NETWORK_DAT_Write(n AS INTEGER)
  58.  The NETWORK_DAT_Write Function updates the record for message conference "n"
  59.  from memory.
  60.  
  61. NETWORK_DAT_Length() AS LONG
  62.  The NETWORK_DAT_Length Function returns the number of records in the
  63.  NETWORK.DAT file.
  64.  
  65. NETWORK_DAT_OpenRead(n AS INTEGER)
  66.  The NETWORK_DAT_OpenRead Function provides the Functionality of the
  67.  NETWORK_DAT_Open and NETWORK_DAT_Read Functions in a single Function call.
  68.  
  69. NETWORK_DAT_WriteClose(n AS INTEGER)
  70.  The NETWORK_DAT_WriteClose Function provides the Functionality of the
  71.  NETWORK_DAT_Write and NETWORK_DAT_Close Functions in a single Function call.
  72.  
  73. NETWORK_DAT_OpenReadClose(n AS INTEGER)
  74.  The NETWORK_DAT_OpenReadClose Function provides the Functionality of the
  75.  NETWORK_DAT_Open, NETWORK_DAT_Read, and NETWORK_DAT_Close Functions in a
  76.  single Function call.
  77.  
  78. NETWORK_DAT_OpenWriteClose(n AS INTEGER)
  79.  The NETWORK_DAT_OpenWriteClose Function provides the Functionality of the
  80.  NETWORK_DAT_Open, NETWORK_DAT_Write, and NETWORK_DAT_Close Functions in a
  81.  single Function call.
  82.  
  83. NETWORK_DAT_ClearIt()
  84.  The NETWORK_DAT_ClearIt Function sets the entire NETWORK_DAT data record for
  85.  'n' to all zeros, leaving all data records in place, but empty.
  86.  
  87. -----------------------------------------------------------------------------
  88. POINTERS Uses a hidden variable I use called "@netwk". Any reference to this
  89. is only for your information for discussion in this doc file. You will not need
  90. to concern yourself trying to use this.. All calls are handled in the main
  91. NETWORK.PBU Unit by my routines automatically. In other words, I am trying to
  92. keep Pointers as easy as possible for your use. :)
  93.  
  94. Also, all calls to any Functions which gets data with the string routines
  95. will auto-trim each string's extra spaces and the null terminator, CHR$(0),
  96. off so printing will be easier for you to manipulate. When calling the string
  97. routines to put data back into the string space, all string data will be
  98. resized to fit the NETWORK.dat type structure and will add the null terminator
  99. back to the end of the string. Just remember, when working the data in memory
  100. with the pointer calls, you still have to write the data back to the
  101. NETWORK.dat in order for the changes to become permanent.
  102.  
  103. -----------------------------------------------------------------------------
  104. NETWORK_DAT_GetNWN() AS STRING
  105.  This form of the NETWORK_DAT_GetNWN function returns a pointer to the
  106.  network's name string.
  107.  
  108. NETWORK_DAT_PutNWN(s AS STRING)
  109.  This form of the NETWORK_DAT_PutNWN function sets the network's name string
  110.  to the string pointed to by "s". Note that the string pointed to by "s" can
  111.  be no more than 40 characters in length.
  112.