home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
PBAPI10.ZIP
/
APIDOCS.ZIP
/
EVENTS.DOC
< prev
next >
Wrap
Text File
|
1998-02-21
|
7KB
|
186 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
EVENTS_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The EVENTS_DAT unit is used to manipulate data in the EVENTS.DAT data file
found in Node's \NWORK directory. The EVENTS_DAT unit is declared in
PBAPI10.INC as follows:
Events.dat EventsDatBitFields Breakdown
EventsDatBitFields.bit1 BIT Assignment
0 = EventExecutedTodayFlag
1 = SlidingEventFlag
2 to 7 Reserved, set to all 0's
Sub Type Structure for 1 byte BitFields
TYPE EventsDatBit
bit1 AS BYTE
END TYPE
File Name: "EVENTS.DAT"
TYPE EVENTSDAT
Time AS STRING * 6
File AS STRING * 13
Day AS INTEGER
EventsDatBitFields AS EventsDatBit
ReservedDataArea AS STRING * 234
END TYPE
DIM EventsDatBit AS EventsDatBit
DIM EVENTSDAT AS SHARED EVENTSDAT
DIM ed AS SHARED EVENTSDAT PTR
ed = VARPTR32(EVENTSDAT)
LSET EVENTSDAT = EVENTSDAT
---------------------------------------------------------------------------
FUNCTION's below are from the EVENTSDAT.PBU Unit and DECLAREd in PBAPI10.INC.
FUNCTION EVENTS_DAT_Open()
FUNCTION EVENTS_DAT_Close()
FUNCTION EVENTS_DAT_Read(n AS INTEGER)
FUNCTION EVENTS_DAT_Write(n AS INTEGER)
FUNCTION EVENTS_DAT_OpenRead(n AS INTEGER)
FUNCTION EVENTS_DAT_WriteClose(n AS INTEGER)
FUNCTION EVENTS_DAT_OpenReadClose(n AS INTEGER)
FUNCTION EVENTS_DAT_OpenWriteClose(n AS INTEGER)
FUNCTION EVENTS_DAT_Length() AS LONG
FUNCTION EVENTS_DAT_ClearIt(n AS INTEGER)
FUNCTION EVENTS_DAT_GetTime() AS STRING
FUNCTION EVENTS_DAT_PutTime(s AS STRING)
FUNCTION EVENTS_DAT_GetFile() AS STRING
FUNCTION EVENTS_DAT_PutFile(s AS STRING)
FUNCTION EVENTS_DAT_GetDay() AS INTEGER
FUNCTION EVENTS_DAT_PutDay(n AS INTEGER)
FUNCTION EVENTS_DAT_GetEETF() AS INTEGER
FUNCTION EVENTS_DAT_PutEETF(n AS INTEGER)
FUNCTION EVENTS_DAT_GetSEF() AS INTEGER
FUNCTION EVENTS_DAT_GetSEF(n AS INTEGER)
---------------------------------------------------------------------------
MPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
before calling any function with the "Open" word.
EVENTS_DAT_Open()
The EVENTS_DAT_Open function opens the EVENTS.DAT file in the node's NWORK
directory.
EVENTS_DAT_Close()
The EVENTS_DAT_Close function closes the EVENTS.DAT file in the node's NWORK
directory.
EVENTS_DAT_Read(n AS INTEGER)
The EVENTS_DAT_Read function reads the record for event "n" into memory.
EVENTS_DAT_Write(n AS INTEGER)
The EVENTS_DAT_Write function updates the record for event "n" from memory.
EVENTS_DAT_OpenRead(n AS INTEGER)
The EVENTS_DAT_OpenRead function provides the functionality of the
EVENTS_DAT_Open and EVENTS_DAT_Read functions in a single function call.
EVENTS_DAT_WriteClose(n AS INTEGER)
The EVENTS_DAT_WriteClose function provides the functionality of the
EVENTS_DAT_Write and EVENTS_DAT_Close functions in a single function call.
EVENTS_DAT_OpenReadClose(n AS INTEGER)
The EVENTS_DAT_OpenReadClose function provides the functionality of the
EVENTS_DAT_Open, EVENTS_DAT_Read, and EVENTS_DAT_Close functions in a single
function call.
EVENTS_DAT_OpenWriteClose(n AS INTEGER)
The EVENTS_DAT_OpenWriteClose function provides the functionality of the
EVENTS_DAT_Open, EVENTS_DAT_Write, and EVENTS_DAT_Close functions in a single
function call.
EVENTS_DAT_Length() AS LONG
The EVENTS_DAT_Length function returns the number of records in the
EVENTS.DAT file.
EVENTS_DAT_ClearIt(n AS INTEGER)
The EVENTS_DAT_ClearIt function sets the entire EVENTS_DAT data record to all
zeros for 'n'.
-----------------------------------------------------------------------------
POINTERS Uses a hidden variable I use called "@ed". 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
EVENTSDAT.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 EVENTS.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
EVENTS.DAT in order for the changes to become permanent.
-----------------------------------------------------------------------------
EVENTS_DAT_GetTime() AS STRING
This form of the EVENTS_DAT_Time function returns the time of the event
string.
EVENTS_DAT_PutTime(s AS STRING)
This form of the EVENTS_DAT_Time function sets the time of the event string
to the string pointed to by "s". Note that the string pointed to by "s" can
be no more than 5 characters in length and must have the form "HH:MM".
EVENTS_DAT_GetFile() AS STRING
This form of the EVENTS_DAT_File function returns the file name for the event
string.
EVENTS_DAT_PutFile(s AS STRING)
This form of the EVENTS_DAT_File function sets the file name for the event
string to the string pointed to by "s". Note that the string pointed to by
"s" can be no more than 12 characters in length.
EVENTS_DAT_GetDay() AS INTEGER
This form of the EVENTS_DAT_Day function returns the day of the event.
EVENTS_DAT_PutDay(n AS INTEGER)
This form of the EVENTS_DAT_Day function sets the day of the event to "n".
"n" must be in the range of 0 to 7 as follows:
0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
7 = Everyday of the week
-----------------------------------------------------------------------------
All BIT Field Flags below have been converted to Integers to allow easier
access and handling.
-----------------------------------------------------------------------------
EVENTS_DAT_GetEETF() AS INTEGER
This form of the EVENTS_DAT_GetEET function returns the event executed today
flag.
EVENTS_DAT_PutEETF(n AS INTEGER)
This form of the EVENTS_DAT_PutEETF function sets the event executed today
flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = FALSE
1 = TRUE
EVENTS_DAT_GetSEF() AS INTEGER
This form of the EVENTS_DAT_GetSEF function returns the sliding event flag.
EVENTS_DAT_PutSEF(n AS INTEGER)
This form of the EVENTS_DAT_PutSEF function sets the event executed today
flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = FALSE
1 = TRUE