home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
powerbbs
/
pbbsw155
/
powrdoor.exe
/
POWRDOOR.DOC
< prev
next >
Wrap
Text File
|
1991-08-20
|
10KB
|
211 lines
PowerBBS's PowerDOOR - A Programmers Door Interface to PowerBBS
(c) 1991 by Russell E. Frey; All Rights Reserved
Support Line (516) 822-7396
To use PowerDOOR, you will need a copy of Turbo Pascal for Windows (tm).
No code produced with PowerDOOR may be sold commercially. You may produce
doors for your own use, or issue the doors into public domain or shareware.
If you want to produce commercial code, then please contact Russell Frey,
for a prior contract and licensing agreement.
Doors produced under the SHAREWARE concept may be distributed, so long
as there are no limitations to the registered version (and must be
shareware as according to the Association of Shareware Professionals).
To produce a door with PowerDOOR, the following requirements are held:
1) You must place powrwin and powrdoor in your uses
statement.
2) You must always begin your program with (begin_live_program(name);) and
end your program with (end_live_program;)
An example program, blackjack, is included in this package (black.pas). As
with any PowerBBS Live Program, to set up the live door, you will place the
following in your live.dat:
c:\wsource\black.exe c:\powrbbs\powrwin.dat,10,
All windows live programs must contain the .exe, and path to the data file.
If you write a door, or code that you would like to distribute, please
upload your programs to the support bbs (516) 822-7396. The existence
of programs using PowerDoor, will give me an incentive to continue
supporting the programming community.
The following procedures/functions/structures are currently available for
your use:
--> procedure begin_live_program(name_of_prog: string);
Use to open PowerDOOR. Name of Prog variable, is the name of your program.
--> procedure end_live_program;
Needed to close PowerDoor.
--> procedure write_com(msg: string);
Writes a string to the user. If user is remote, information is sent
to the com port, etc.
--> procedure writeln_com(msg: string);
Same as write_com, except a return is entered at the end of output.
--> function infotext(pline: string): string;
Will interpret |MACROS|. For example, you can do:
writeln_com(infotext('Welcome |NAME|'));
--> function drop_carrier: boolean;
If user is not online, then this function is set to TRUE. You should always
use this in any loop structure, such as:
Repeat
delay(50);
Until (drop_carrier) or (your statements);
--> procedure get_a_return;
Tells the user to press return (or enter), and will wait till it is pressed.
--> procedure activity(stringtowrite: string);
Writes the information to the activity_log file.
--> procedure clearscreen;
Clears the screen, including the users screen, if ANSI is turned on.
--> procedure type_file(file: string);
Types a file to the user. If you use type_file('wel'), then the file
wel, will be displayed. If welc is available, and the user has ANSI
capability, then it will be displayed. (Notice c for color)
--> procedure ask_user(input_string: string;
max_input_length: integer);
This procedure should be used to get input from the user, such as a
Readln(string), statement. Notice that max_input_length, is the
maximum length the string input is permitted to be.
--> function input_char: char;
This function will receive one character from the user.
--> function get_hotkey_yn: boolean;
This procedure will wait until the keys y or n are pressed. It will display
Yes or No, and a return after the key has been pressed.
get_hotkey_yn is TRUE if yes is pressed.
--> procedure writelncom;
This procedure will return a blank return to the screen. You could
do the same thing with writeln_com('');
--> procedure save_userinfo;
This program will save the USERINFO record. Use this only if you want
to save updated information.
--> function asc_to_int(temps: string): integer;
Converts an ascii string to an integer
--> function int_to_asc(tempint: integer): string;
Converts an integer to a string
--> procedure upper_string(var tempstring: string);
Converts all letters to capital in a string
--> procedure delete_after_spaces(var tempstring: string);
Removes any spaces at the end of a string
--> procedure delete_before_spaces(var tempstring: string);
Removes any spaces at the beginning of a string
--> procedure delay(time_ms: longint);
Delays and yields control, for the specified milliseconds.
Delay(1000) = delay and yield control for 1 full second.
You should enter this if you have a repeat -- until, to yeild control
to other applications.
--> function SENDRED: string; Sends ANSI foreground RED
--> function SENDGREEN: string; Sends ANSI foreground GREEN
--> function SENDYELLOW: string; Sends ANSI foreground YELLOW
--> function SENDBLUE: string; Sends ANSI foreground BLUE
--> function SENDMAGENTA: string; Sends ANSI foreground MAGENTA
--> function SENDCYAN: string; Sends ANSI foreground CYAN
--> function SENDWHITE: string; Sends ANSI foreground WHITE
--> function SENDGRAY: string; Sends ANSI foreground GRAY
--> function SENDBrown: string; Sends ANSI foreground BROWN
--> function SENDBLUEBACK:string; Sends ANSI background BLUE
--> function SENDRedback: string; Sends ANSI background RED
--> function SENDPUPback: string; Sends ANSI background PURPLE
The following record is available, via the USERINFO. declaration.
For example, USERINFO.NAME would be the current Users Name.
Type Forum_Type = Record
Options: Byte; {Forum Options:
Bit0: Access No/Yes
Bit1: Scan No/Yes}
Lastread: Single; {Last message read pointer}
End;
Type PowrUser = Record {Format of the USER database}
Name: Packed Array[1..25] Of Char; {User Name}
Location: Packed Array[1..20] Of Char; {User Location}
Computer: Packed Array[1..15] Of Char; {User Computer Type}
Phone_Number: Packed Array[1..14] Of Char; {User Phone Number}
Password: Packed Array[1..10] Of Char; {User Password}
Birthday: DateType; {date of birth}
First_Call: DateType; {date of first logon}
Last_File_Scan: DateType; {date of last NEW scan}
Expiration_Date: DateType; {date subscription ends}
Last_Call: DateType; {date of last logoff}
Last_Time: TimeType; {time of last logoff}
Calls: Integer; {total number of calls}
Uploads: Integer; {number of uploads}
Downloads: Integer; {number of downloads}
Time_on: Integer; {time on today}
Today_bytes: Double; {bytes downloaded today}
Download_Bytes: Double; {bytes downloaded}
Uploads_Bytes: Double; {bytes uploaded}
Forum_Data: Array[0..200] Of Forum_Type;
Access: Byte; {access level}
Expiration_Access: Byte; {access after expiration
date}
Screen_lines: Byte; {number of lines to a screen}
Safe_Total: Byte; {total minutes in safe}
Options: Byte; {options:
bit0: Expert On/Off
bit1: Hotkey On/Off
bit2: Bad User On/Off}
Xproto: Byte; {default file xfer protocol}
Monitor_Type: Char; {type of monitor:
'C' => Color
'M' => Monochrome
'N' => None}
Messages_Left: Word; {Number of messages left}
Reserved: Array[1..200] of byte;
End;
The following record, can be interfaced by using the CALLINFO record.
For example, the name is CALLINFO.NAME
Type Powr_CallInfo = Record {Format of Callers Info File For Live Programs}
Name: Packed Array[1..25] Of Char; {User Name}
User_Pointer: Integer; {User Record # starting at 1}
BaudRate: Packed Array[1..5] Of Char; {Baud rate to send at}
Scomport: Char; {Com Number to send at}
What_Menu: byte; {Current Menu}
Graphics: Char; {Graphics Type:
'C' => Color
'M' => Monochrome
'N' => None}
Access: Byte; {User Access Level}
ForumNum: Byte; {Current Forum Number}
Logon_Time: TimeType; {time of logon}
Logon_Mins: Integer; {time the user logged on in mins}
Used_today: integer; {time the user used in
previous calls so far today}
Time_Limit: integer; {Maximum mins permitted on bbs}
Kdownload_Maximum: Integer; {Maximum download bytes in K}
Upload_Credit: Integer; {Minutes given for Uploading}
Minutes_Useable: Integer; {Maximum Time left for caller}
Node_Num: Byte; {The node number of this callinfo file}
Path_Data: string[30]; {path to powrwin.dat}
Reserved1: Array[1..2] Of Char;
Reserved2: Byte;
Reserved3: Longint;
End;