home *** CD-ROM | disk | FTP | other *** search
- Author....... : Gary Price
- Copyrighted by: Freejack's Software 1997-98
-
- NETWORK_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
- ---------------------------------------------------------------------------
-
- The NETWORK_DAT unit is used to manipulate data in the NETWORK.DAT data file
- found in node 1's MWORK directory. The NETWORK_DAT unit is declared in
- PBAPI10.INC as follows:
-
- File Name: Main Type Structure for "NETWORK.DAT" file
-
- TYPE NETWORK
- NetworkName AS STRING * 41
- ReservedDataArea AS STRING * 215
- END TYPE
-
- DIM NETWORK AS SHARED NETWORK
- DIM netwk AS SHARED NETWORK PTR
-
- netwk = VARPTR32(NETWORK)
- LSET NETWORK = NETWORK
- ---------------------------------------------------------------------------
-
- FUNCTION's below are from the NETWORK.PBU Unit and DECLAREd in PBAPI10.INC.
-
- FUNCTION NETWORK_DAT_OPEN()
- FUNCTION NETWORK_DAT_CLOSE()
- FUNCTION NETWORK_DAT_READ(n AS INTEGER)
- FUNCTION NETWORK_DAT_WRITE(n AS INTEGER)
- FUNCTION NETWORK_DAT_Length() AS LONG
- FUNCTION NETWORK_DAT_OpenRead(n AS INTEGER)
- FUNCTION NETWORK_DAT_WriteClose(n AS INTEGER)
- FUNCTION NETWORK_DAT_OpenReadClose(n AS INTEGER)
- FUNCTION NETWORK_DAT_OpenWriteClose(n AS INTEGER)
- FUNCTION NETWORK_DAT_Clearit(n AS INTEGER)
-
- FUNCTION NETWORK_DAT_GetNWN() AS STRING
- FUNCTION NETWORK_DAT_PutNWN(s AS STRING)
-
- ---------------------------------------------------------------------------
- IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
- before calling to any Function with the "OPEN" command in it.
-
- NETWORK_DAT_Open
- The NETWORK_DAT_Open Function opens the NETWORK.DAT data file in node 1's
- MWORK directory.
-
- NETWORK_DAT_Close
- The NETWORK_DAT_Close Function closes the NETWORK.DAT data file in node 1's
- MWORK directory.
-
- NETWORK_DAT_Read(n AS INTEGER)
- The NETWORK_DAT_Read Function reads the record for message conference "n"
- into memory.
-
- NETWORK_DAT_Write(n AS INTEGER)
- The NETWORK_DAT_Write Function updates the record for message conference "n"
- from memory.
-
- NETWORK_DAT_Length() AS LONG
- The NETWORK_DAT_Length Function returns the number of records in the
- NETWORK.DAT file.
-
- NETWORK_DAT_OpenRead(n AS INTEGER)
- The NETWORK_DAT_OpenRead Function provides the Functionality of the
- NETWORK_DAT_Open and NETWORK_DAT_Read Functions in a single Function call.
-
- NETWORK_DAT_WriteClose(n AS INTEGER)
- The NETWORK_DAT_WriteClose Function provides the Functionality of the
- NETWORK_DAT_Write and NETWORK_DAT_Close Functions in a single Function call.
-
- NETWORK_DAT_OpenReadClose(n AS INTEGER)
- The NETWORK_DAT_OpenReadClose Function provides the Functionality of the
- NETWORK_DAT_Open, NETWORK_DAT_Read, and NETWORK_DAT_Close Functions in a
- single Function call.
-
- NETWORK_DAT_OpenWriteClose(n AS INTEGER)
- The NETWORK_DAT_OpenWriteClose Function provides the Functionality of the
- NETWORK_DAT_Open, NETWORK_DAT_Write, and NETWORK_DAT_Close Functions in a
- single Function call.
-
- NETWORK_DAT_ClearIt()
- The NETWORK_DAT_ClearIt Function sets the entire NETWORK_DAT data record for
- 'n' to all zeros, leaving all data records in place, but empty.
-
- -----------------------------------------------------------------------------
- POINTERS Uses a hidden variable I use called "@netwk". Any reference to this
- is only for your information for discussion in this doc file. You will not need
- to concern yourself trying to use this.. All calls are handled in the main
- NETWORK.PBU Unit by my routines automatically. In other words, I am trying to
- keep Pointers as easy as possible for your use. :)
-
- Also, all calls to any Functions which gets data with the string routines
- will auto-trim each string's extra spaces and the null terminator, CHR$(0),
- off so printing will be easier for you to manipulate. When calling the string
- routines to put data back into the string space, all string data will be
- resized to fit the NETWORK.dat type structure and will add the null terminator
- back to the end of the string. Just remember, when working the data in memory
- with the pointer calls, you still have to write the data back to the
- NETWORK.dat in order for the changes to become permanent.
-
- -----------------------------------------------------------------------------
- NETWORK_DAT_GetNWN() AS STRING
- This form of the NETWORK_DAT_GetNWN function returns a pointer to the
- network's name string.
-
- NETWORK_DAT_PutNWN(s AS STRING)
- This form of the NETWORK_DAT_PutNWN function sets the network's name string
- to the string pointed to by "s". Note that the string pointed to by "s" can
- be no more than 40 characters in length.
-