home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
QBAS
/
DWDOOR23.ZIP
/
DWDOOR.DOC
< prev
next >
Wrap
Text File
|
1993-08-25
|
121KB
|
6,598 lines
PowerBASIC DW-Door version 2.3
Door Programmer's Toolkit for PowerBASIC 3.0b
(C) Copyright 1993 by James R. Davis - All Rights Reserved
Shareware Release Documentation
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
About the DWDoor Library:
DWDoor is a group of useful commands for the PowerBASIC
programmer to allow advanced routines for writing and creating
BBS door programs that will work with virtually any BBS program
available today. With this set of routines there isn't any
limit to the type of door you can write except your own
imagination.
DWDoor is a shareware product. Shareware means that you as
a user may use it for a trial period at no cost. If you
continue to use the routines after that trial period, a
registration fee of $35 is suggested. Anyone sending in $75 or
more will receive the latest version of DWDoor and a printed and
bound manual
Commercial users must pay the registration fee, and all
commercial programs must include, either in the documentation,
or displayed in the program itself, the copyright notice for
DWDoor. Note: Commercial programs are any program that you
write and receive payment for (including shareware). All users
are encouraged to send in a voluntary contribution to help with
development costs for future versions.
Support:
Support for DWDoor is provided by James R. Davis who may be
contacted at 3 Williams Blvd - 1C, Lake Grove, NY 11755 or
through the Programmer's Mega-Source at (516) 737-4637 with your
1200/2400/9600/14400/V32bis modem at 8 bits, No parity, and 1
stop bit. Registered users will also have access to a technical
support voice number for any questions or comments.
Warranty:
DWDoor is supplied "AS IS", and there is no warranty of any
kind expressed or implied, including, without limitation. the
warranties of merchantability and of the fitness for any
purpose. The author assumes no liability for any damages,
direct or consequential, which may result from the use or misuse
of DWDoor.
Acknowledgments:
I would like to thank Dave Navarro, Jr. for all his
wonderful help and inspiration, and for introducing me to the
power of PowerBASIC. Without his help and support, I probably
would still be debating on whether or not to upgrade my doors,
which inspired this library. I would like to thank Bob Zale for
creating what I think is the BEST basic compiler available.
Without it, I'd still be programming and wasting space in QB. I
would also like to thank Michael Cleverly for writing his Cat
Patch routines that got me started in door programming. Without
his work and dedication, I would never have had an interest in
writing doors of any kind. And most of all YOU for using this
library! THANK YOU MOST OF ALL!
Page 2
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
Table of Contents
About the DWDoor Library ....................................... 2
Support ........................................................ 2
Warranty ....................................................... 2
Acknowledgments ................................................ 2
How to Use DWDoor in Your Program .............................. 5
Variable and SUB/FUNCTION List Quick Reference ................. 6
DWDoor's Routines and Variables
Ansi% ........................................................ 9
AnsiColor$() ................................................. 10
AnsiLocate$() ................................................ 11
Attr%() ...................................................... 12
BBS$ ......................................................... 13
Back% ........................................................ 14
Baud& ........................................................ 15
Beeper& ...................................................... 16
CLR .......................................................... 17
CR$ .......................................................... 18
CRLF$ ........................................................ 19
Carrier%() ................................................... 20
Center$() .................................................... 21
CheckTime .................................................... 22
ComInit$ ..................................................... 23
ComParity% ................................................... 24
ComPort% ..................................................... 25
Comm% ........................................................ 26
CommKey$ ..................................................... 27
DCSRLIN% ..................................................... 28
DPos% ........................................................ 29
DPrint() ..................................................... 30
DVGivUp ...................................................... 31
DVPrint() .................................................... 32
DataLen%() ................................................... 33
DoorHelp$ .................................................... 34
DoorInfo$() .................................................. 35
DoorInit() ................................................... 36
DoorName$ .................................................... 37
ErrorFile$ ................................................... 38
ErrorLev% .................................................... 39
Exist%() ..................................................... 40
ExitDoor() ................................................... 41
Extra$ ....................................................... 42
False% ....................................................... 43
FirstName$ ................................................... 44
Fore% ........................................................ 45
GetBaud&() ................................................... 46
GetExtra$() .................................................. 47
GetLocalInfo ................................................. 48
Help() ....................................................... 49
InComm$() .................................................... 50
IRQ$ ......................................................... 51
InText$ ...................................................... 52
KBLocal% ..................................................... 53
KBTime& ...................................................... 54
LBack$ ....................................................... 55
Page 3
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
LBackSp$ ..................................................... 56
LastName$ .................................................... 57
Line25 ....................................................... 58
MaxTime& ..................................................... 59
More% ........................................................ 60
NormalColor$ ................................................. 61
Okay% ........................................................ 62
OutComm() .................................................... 63
Pause ........................................................ 64
Parity%() .................................................... 65
Parm$() ...................................................... 66
PrintFile() .................................................. 67
RBack$ ....................................................... 68
RBackSp$ ..................................................... 69
Serial$ ...................................................... 70
Script() ..................................................... 71
Scrn2Ansi$() ................................................. 72
StopBits%() .................................................. 73
SysopF$ ...................................................... 74
SysopL$ ...................................................... 75
SysopName$ ................................................... 76
TestComm ..................................................... 77
TimeIn& ...................................................... 78
TimeLeft& .................................................... 79
Trim$() ...................................................... 80
True% ........................................................ 81
UserName$ .................................................... 82
WriteDoorERR() ............................................... 83
The CFG File ................................................... 84
CFG Variable List .............................................. 85
CFG Variables
BBSNAME ...................................................... 86
COMPORT ...................................................... 87
DOORFILE ..................................................... 88
EXTRA ........................................................ 89
IRQ .......................................................... 90
KBTIME ....................................................... 91
MAXTIME ...................................................... 92
SERIAL ....................................................... 93
SYSOPF ....................................................... 94
SYSOPL ....................................................... 95
Making your own CFG Variables ................................ 96
Author's Notes and Suggestions ................................. 97
Error Messages ................................................. 99
Closing ........................................................ 100
Page 4
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
How to Use DWDoor in Your Program:
All of the routines in the DWDoor UNIT files have been
declared public so you may just include the statement for each
function or subroutine, or use the variable provided you use the
proper syntax for each as described in the examples provided in
the description for each routine. Note that all numeric
variables are integers unless otherwise indicated. This helps
to speed the operation of the routines and your program. To
include all the routines in DWDoor, just place the following
statement at the top of your program:
$INCLUDE "DWDOOR.INC"
Make sure that both the DWDOOR.INC and all the UNIT files
are located in the proper directories as setup by your editor.
The DWDOOR.CFG file is an ASCII text file that the routines read
from to set defaulting variables used in your program. The
format of this file remains constant for every door file that
you create. You can rename this file to whatever you wish. It
will be the file called upon during initial execution of your
door on the command line.
The command line options are ?, which will bring up a help
file set by you in the DoorHelp$; LOCAL will put the user into
local mode, this can also be achieved by no command line option;
or the name of the .CFG to be used (e.g.: DWDOOR DWDOOR.CFG).
I have also included a way to protect your work by setting
the variable SERIAL=serial-code in the CFG file at any time.
The information that is stored in the CFG file's SERIAL variable
can be can be retrieved from the Serial$ (see description) and
used to test if the door would be registered or not. You can
then pass a -1 to the Okay% variable to tell the rest of the
program that the program is registered.
Here's a small example routine you can write to test your
serial codes:
CALL SerialCode(Serial$,SysopName$)
SUB SerialCode(Tmp1$,Tmp2$)
FOR X%=1 TO LEN(Tmp2$)
INCR A%,ASC(MID$(Tmp2$,1,1)
NEXT X%
IF Tmp1$=Trim$(STR$(A%)) THEN Okay%=-1
END SUB
I suggest you not use this EXACT example, but as you can
see, the possibilities are endless as to the complexity you wish
to make your registration test routine.
Page 5
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
Variable and SUB/FUNCTION List Quick Reference
Name Type Description
---- ---- -----------
Ansi% - Integer - -1 if ANSI allowed, 0 if not.
AnsiColor$() - Function - Returns an ANSI command for
specified color.
AnsiLocate$() - Function - Returns an ANSI command for
locating the cursor.
Attr%() - Function - Returns an integer representation
of fore/background colors.
BBS$ - String - The BBS name.
Back% - Integer - Current background color.
Baud& - Long Integer - The baud rate of ComPort%.
Beeper& - Long Integer - Millisecs before beep for no input.
CLR - Subroutine - Clears the local and remote screens
CR$ - 1-CHR String - Carriage return: CHR$(13).
CRLF$ - 2-CHR String - Return + Linefeed:
CHR$(13)+CHR$(10).
Carrier%() - Function - Returns a non-zero number if
carrier is detected on ComPort%.
Center$() - Function - Returns a string centered in
specified amount of spaces.
CheckTime - Subroutine - Checks time limit of user and ends
program if exceeded.
ComInit$ - String - String for opening com port.
ComParity% - Integer - The parity of ComPort%.
ComPort% - Integer - The comport number (0-8).
Comm% - Integer - OPENed COM port number, used for
printing text directly to remote.
CommKey$ - Function - Gets key from user, same as INKEY$.
DCSRLIN% - Function - Returns DOS current cursor row
position.
DPos% - Function - Returns DOS current cursor column
position.
DPrint() - Subroutine - Prints a string through DOS instead
of directly.
DVGivUp - Subroutine - Gives up time for DesqView
prompting.
DVPrint() - Subroutine - Prints a string directly without
DesqView bleed-through.
DataLen%() - Function - Returns the current Databit length
of ComPort%.
DoorHelp$ - String - The filename displayed when ? used
on command line.
DoorInfo$() - Function - Opens BBS door files or get info
directly from comport.
DoorInit() - Subroutine - Initializes all variables.
DoorName$ - String - Full name of the door.
ErrorFile$ - String - The filename to write errors to.
ErrorLev% - Function - Returns SHELLed ERRORLEVEL.
Exist%() - Function - Returns a non-zero if file exists.
ExitDoor() - Subroutine - Exits back to the BBS with
ERRORLEVEL if supplied.
Extra$ - String - Extra string of 70 characters or
less (optional).
Page 6
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
False% - Integer - Constant 0.
FirstName$ - String - User's First name.
Fore% - Integer - Current foreground color.
GetBaud&() - Function - Returns current baud rate ComPort%
(up to 38400 baud).
GetExtra$() - Function - Retrieves extra CFG variable info.
GetLocalInfo - Subroutine - If in local mode, gets local info.
Help() - Subroutine - Displays DoorHelp$ to screen if ?
is used on command line.
InComm$() - Function - Gets input from KB and Remote with
many options.
InText$ - String - Extra input from the user.
IRQ$ - String - The number of the IRQ for non-
standard comports.
KBLocal% - Integer - -1 if LOCAL, 0 if at REMOTE.
KBTime& - Long Integer - KB time-out limit in seconds.
LBack$ - 1-CHR String - Local non-destructive backspace.
LBackSp$ - 3-CHR String - Local destructive backspace
LastName$ - String - User's Last name.
Line25 - Subroutine - Prints info about user and door on
lines 24 and 25.
MaxTime& - Long Integer - Maximum amount of time in door
allowed in secs.
More% - Function - More prompt with Yes, No, and
Continuous.
NormalColor$ - 4-CHR String - ANSI color code of White on Black.
Okay% - Integer - -1 if serial code matches, 0 if not
OutComm() - Subroutine - Prints string to screen and remote
with ANSI support.
Pause - Subroutine - Asks user to "Press any key to
continue."
Parity%() - Function - Returns current parity of ComPort%.
Parm$() - Function - Parses strings to any specified
character.
PrintFile() - Subroutine - Prints an entire file out to the
user and the screen.
RBack$ - 1-CHR String - Remote non-destructive backspace.
RBackSp$ - 3-Byte String - Remote destructive backspace.
Script() - Subroutine - Allows you to access all routines
via normal text strings.
Scrn2Ansi$() - Function - Converts a given screen window into
an ANSI string.
Serial$ - String - Returned from SERIAL variable in
.CFG file.
StopBits%() - Function - Returns stop-bits of ComPort%.
SysopF$ - String - The Sysop's First name.
SysopL$ - String - The Sysop's Last name.
SysopName$ - UCASE String - The Sysop's full name (Uppercase).
TestComm - Subroutine - Tests the current com port and
exits if carrier is dropped, unless
local.
TimeIn& - Long Integer - Time user started program in
seconds.
TimeLeft& - Long Integer - Total time left in door in seconds.
Trim$() - Function - Trims string of spaces on both ends
True% - Integer - Constant -1.
Page 7
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
UserName$ - UCASE String - User's full name (Uppercase).
WriteDoorERR() - Subroutine - Writes and error out to ErrorFile$
and ends with supplied ERRORLEVEL.
Page 8
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Ansi% Integer -1 if ANSI allowed, 0 if not.
-------------------------------------------------------------------
With this variable you can test to see if the user is able to
support ANSI graphics on the BBS and whether or not the user has
ANSI turned on. This variable can be reassigned to the value you
wish.
Syntax:
A% = Ansi%
See Also: True%
Example:
IF Ansi% = True% THEN
PRINT "User has ANSI graphics turned on."
ELSE
PRINT "User has ANSI graphics turned off."
END IF
Page 9
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
AnsiColor$() Function An ANSI color command.
-------------------------------------------------------------------
By using this function you can automatically get the ANSI command
for changing to the color you specify. If ANSI is not on, this will
return a null string.
Syntax:
A$ = AnsiColor$(Attr%(7,0))
See Also: Ansi%, AnsiLocate$(), Attr%()
Example:
IF Ansi% = True% THEN
A$ = AnsiColor$(Attr%(14, 1) + " This is a warning message! "
ELSE
A$ = "This is a warning message without color!"
END IF
Page 10
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
AnsiLocate$() Function An ANSI cursor locating command.
-------------------------------------------------------------------
By using this function you can automatically get the ANSI command
for locating the cursor. If ANSI is off, this will return a null
string.
Syntax:
A$ = AnsiLocate$(Row%,Col%)
Where Row% = The line on the screen to position to.
Col% = The column on the screen to position to.
See Also: AnsiColor$()
Example:
IF Ansi% = True% THEN
CALL CLR
A$ = AnsiLocate$(12, 1) + Center$("Hello There!")
CALL OutComm(Attr%(14, 4), 1, A$)
ELSE
CALL OutComm(7, 1, Center$("Hello There!"))
END IF
Page 11
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Attr%() Function Single integer of fore/background.
-------------------------------------------------------------------
Calculates a single integer from foreground and background values
that you specify. Use this routine to change colors in any
subroutine or function that requires a single color variable.
Syntax:
Color% = Attr%(Foreground%,Background%)
Where Foreground% = Any color of the color table below.
Background% = Any color from 0 to 7 of color table.
Color Table:
0 = Black 8 = Grey
1 = Blue 9 = Light Blue
2 = Green 10 = Light Green
3 = Cyan 11 = Light Cyan
4 = Red 12 = Light Red
5 = Magenta 13 = Light Magenta
6 = Brown 14 = Yellow
7 = White 15 = Bright White
See Also: AnsiColor$(), Back%, Fore%
Example:
WHILE A$ <> CHR$(27)
LINE INPUT "Enter a foreground color value: ", Fore$
LINE INPUT "Enter a background color value: ", Back$
Fore% = VAL(Fore$)
Back% = VAL(Back$)
PRINT
PRINT "Attribute Value ="; Attr%(Fore%, Back%)
PRINT
PRINT "Press any key to do it again, ESC to quit:";
A$ = INPUT$(1)
WEND
Page 12
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
BBS$ String The BBS name.
-------------------------------------------------------------------
This string will contain the BBS name that the door will be running
under. It is taken directly from the .CFG file and is set by the
BBSNAME variable within it. This variable can be reassigned.
Syntax:
A$ = BBS$
See Also: BBSNAME
Example:
PRINT "The name of the BBS using this program is: "; BBS$
Page 13
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Back% Integer Current background color.
-------------------------------------------------------------------
Contains the currently used background color.
Syntax:
A% = Back%
See Also: Fore%
Example:
PRINT "The current background color is"; Back%
Page 14
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Baud& Long Integer The baud rate of com port.
-------------------------------------------------------------------
This variable contains the current baud rate of the com port being
used. This variable can be reassigned but won't change the current
speed of the com port.
Syntax:
A& = Baud&
See Also: GetBaud&()
Example:
PRINT "The current baud rate being used is"; Baud&
Page 15
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Beeper& Long Integer Milliseconds before beep for no input.
-------------------------------------------------------------------
This variable contains the number of milliseconds before a beep
sounds on remote for no input. To determine seconds, use the
formula [Beeper& = Seconds * 180]. Default value is 30 seconds.
Syntax:
A& = Beeper&
See Also: KBTime&, MaxTime&
Example:
LINE INPUT "How many minutes before the beeper sounds?"; A$
Bpr% = VAL(A$)
Beeper& = (Bpr% * 180) * 60
Page 16
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
CLR Subroutine Clears the local and remote screens
-------------------------------------------------------------------
Using this subroutine you can clear the screen without destroying
the last to lines on the screen. Avoid using CLS by using this
subroutine, unless you wish to clear the status line.
Syntax:
CALL CLR
See Also: Pause
Example:
PRINT "Press any key to clear the screen: ";
A$ = INPUT$(1)
CALL CLR
Page 17
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
CR$ 1-CHR String Carriage return: CHR$(13).
-------------------------------------------------------------------
This is a 1 character string that contains a carriage return.
Syntax:
A$ = CR$
See Also: CRLF$, LBack$, LBackSp$, RBack$, RBackSp$
Example:
A$ = "This will print with a carriage return" + CR$
B$ = "This will print over the first.."
CALL OutComm(7, 0, A$)
CALL OutComm(7, 0 ,B$)
Page 18
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
CRLF$ 2-CHR String Return + Linefeed: CHR$(13)+CHR$(10).
-------------------------------------------------------------------
This string contains 2 characters. A carriage return and a
linefeed.
Syntax:
A$ = CRLF$
See Also: CR$, LBack$, LBackSp$, RBack$, RBackSp$
Example:
A$ = "This will print with a carriage return" + CRLF$
B$ = "This will print on the next line.."
CALL OutComm(7, 0, A$)
CALL OutComm(7, 0 ,B$)
Page 19
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Carrier%() Function Non-zero if carrier is detected.
-------------------------------------------------------------------
This function will return a non-zero number if a carrier is detected
on a com port number.
Syntax:
A% = Carrier%(C%)
Where C% = The number of the com port to test, a number from 1
to 8.
See Also: GetBaud&(), Parity%()
Example:
FOR X% = 1 TO 8
IF Carrier%(X%) THEN
PRINT "A carrier was detected on COM"; LTRIM$(STR$(X%)); ":"
ELSE
PRINT "No carrier detected on COM"; LTRIM$(STR$(X%)); ":"
END IF
NEXT X%
Page 20
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Center$() Function Centers in specified amount of spaces
-------------------------------------------------------------------
Centers a string within a specified number of spaces. This now can
handle ANSI color sequences, but ANSI location sequences will throw
it off!
Syntax:
A$ = Center$(Text$,Col%)
Where Text$ = The text you want to center.
Col% = The amount of spaces to center Text$ in.
See Also: Trim$()
Example:
A$ = Center$("This will print centered in Yellow", 79)
CALL OutComm$(14, 0, A$)
Page 21
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
CheckTime Subroutine Checks time limit of user and ends.
-------------------------------------------------------------------
Checks the time remaining within the program and exits the program
if the time limit has expired or has exceeded. If InComm$() is
waiting for input from remote, the remote terminal will beep once
every Beep& seconds.
Syntax:
CALL CheckTime
See Also: Beeper&, TestComm
Example:
WHILE NOT INSTAT
CALL CheckTime
CALL TestComm
WEND
A$ = INKEY$
Page 22
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ComInit$ String Complete string for opening com port.
-------------------------------------------------------------------
ComInit$ is the complete string for opening the com port. It
contains the following information:
"COMx:baud,parity,databits,stopbits,CS,DS,CD,PE,DT,ME,FE,IRx"
If you wish to use other perimeters than the ones used, simply CLOSE
Comm%, get the data you wish from this string, and OPEN ComInit$ AS
Comm% again.
Syntax:
A$ = ComInit$
See Also: Comm%, ComParity%
Example:
PRINT "The current comport initialization string contains:"
WRITE ComInit$
Page 23
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ComParity% Integer The parity of ComPort%.
-------------------------------------------------------------------
This variable contains the current user's parity setting in easy
integer. If ComParity% = 8 then the parity setting is 8-N-1, else
if ComParity% = 7 then the parity setting is 7-E-1.
Syntax:
A% = ComParity%
See Also: Baud&, ComInit$
Example:
PRINT "The connection type of this connection is: ";
IF ComParity% = 8 THEN
PRINT "8-N-1"
ELSE
PRINT "7-E-1"
END IF
Page 24
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ComPort% Integer The comport number (0-8).
-------------------------------------------------------------------
This is the com port number that is being used. It will be a number
from 1 to 8, or 0 if the user is on LOCALLY. If the user is using a
non-standard port address, this will be set to 1.
Syntax:
A% = ComPort%
See Also: Baud&, Comm%, ComParity%
Example:
PRINT "The current comport in use is COM"; LTRIM$(STR$(ComPort%))
Page 25
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Comm% Integer OPENed COM port number used.
-------------------------------------------------------------------
This is the file handle that all routines use for communications.
It is the OPENed com port number. If you reassign this variable,
you better make sure that you have it set for an OPENed com port!
Syntax:
A% = Comm%
See Also: Baud&, ComParity%, GetBaud&(), Parity%()
Example:
PRINT "This will be printed on the local screen only!"
PRINT Comm%, "This will be printed to the comport only!"
CALL OutComm(7, 1, "This will be printed to both")
Page 26
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
CommKey$ Function Gets one key from user like INKEY$
-------------------------------------------------------------------
Use this function to get one character from either the com port or
the key board. This function acts the same way that INKEY$ does
only it will test for com port activity and time left in the
program. Note that with this function you can continue to update
the display while waiting for the user to press a key!
Syntax:
A$ = CommKey$
See Also: InComm$()
Example:
A$ = CommKey$
WHILE A$ = ""
A$ = CommKey$
CALL OutComm(7, 1, "Press any key to stop this display")
WEND
Page 27
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DCSRLIN% Function DOS's current cursor row position.
-------------------------------------------------------------------
Returns the current location of the DOS cursor position in the same
fashion as CSRLIN, only this takes into account ANSI relocation of
the cursor as well.
Syntax:
A% = DCSRLIN%
See Also: DPos%
Example:
PRINT "The current cursor line is"; DCSRLIN%
Page 28
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DPos% Function DOS's current cursor column position.
-------------------------------------------------------------------
Returns the current location of the DOS cursor position in the same
fashion as POS(0), only this takes into account ANSI relocation of
the cursor as well.
Syntax:
A% = DPos%
See Also: DCSRLIN%
Example:
PRINT "The current cursor row is"; DPos%
Page 29
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DPrint() Subroutine Prints a string through DOS.
-------------------------------------------------------------------
Prints a string to the screen through DOS allowing for ANSI commands
to be displayed correctly.
Syntax:
CALL DPrint(Text$)
Where Text$ = The string to print.
See Also: DVPrint()
Example:
FOR X% = 1 TO 30
CALL DPrint("This should scroll in the user window")
NEXT
Page 30
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DVGivUp Subroutine Gives up time for DesqView prompting.
-------------------------------------------------------------------
Gives up a time slice to the window running this program if DesqView
or DoubleDOS is installed.
Syntax:
CALL DVGivUp
See Also: DVPrint()
Example:
CALL DVGivUp
LINE INPUT "Enter any value here, I can wait: "; A$
Page 31
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DVPrint() Subroutine Prints a string directly through DV.
-------------------------------------------------------------------
Directly prints a string to the screen without window bleed through,
if DesqView or DoubleDOS is installed. Use this instead of the
PRINT command.
Syntax:
CALL DVPrint(Row%,Col%,Text$,Atr%)
Where Row% = The row to locate the cursor.
Col% = The column to locate the cursor.
Text$ = The string to print at Row%, Col%.
Atr% = The integer color attribute to print in.
See Also: DVGivUp
Example:
CALL DVPrint(12, 1, Center$("Warning!", 79), Attr%(14, 4))
Page 32
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DataLen%() Function The current Databit length of comport.
-------------------------------------------------------------------
Returns the data length of a com port. Either 7 or 8.
Syntax:
A% = DataLen%(C%)
Where C% = The com port to get data from, can be a number from
1 to 8.
See Also: ComPort%, GetBaud&(), StopBits%()
Example:
FOR X% = 1 TO 8
IF Carrier%(X%) THEN
PRINT "The data length of COM";
PRINT LTRIM$(STR$(X%)); ": is"; DataLen%(X%)
END IF
NEXT
Page 33
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DoorHelp$ String The filename displayed when ? used.
-------------------------------------------------------------------
Set this variable to equal the name of the help file that will be
displayed whenever a user enters a "?" (question mark) alone on the
command line. It will display that file and ask if the user would
like to enter the program in local mode. You can find this variable
in the DWDOOR.INC file.
Syntax:
DoorHelp$ = "DWDOOR.HLP"
See Also: DoorName$, ErrorFile$
Page 34
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DoorInfo$() Function Opens BBS door files and get info.
-------------------------------------------------------------------
Will get the information from the supplied filename to retrieve user
info. If the filename passed is "DIRECT" then the input is taken
directly from the modem, and the user is asked to enter their full
name. It will return a 73 character string that contains the
following information:
First 30 characters = The User's full name.
Next 1 character = Y for ANSI allowed, N if not.
Next 2 characters = 2 byte integer of time allowed.
Next 33 characters = The com port initializing string.
Last 7 characters = Reserved for future use.
Syntax:
A$ = DoorInfo$(File$)
Where File$ = the BBS Door type listed below.
PCBOARD.SYS - PCBoard version 12 & 14.x or above.
USERS.SYS - PCBoard 15.0 beta
CALLINFO.BBS - Wildcat version 2.0 or above.
DOOR.SYS - GAP any version.
DORINFO#.DEF - RBBS and QBBS Systems (# is node).
CHAIN.TXT - WWIV version 2.x or above.
DIRECT - Will attempt to get all info from modem.
See Also: DoorInit()
Page 35
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DoorInit() Subroutine Initializes all variables for DWDoor.
-------------------------------------------------------------------
This routine will set up all the variables for door operations to
proceed normally. This routine must be called upon FIRST by passing
the COMMAND$ to it. Any other time, you must supply the name of the
CFG file. If you wish to parse the COMMAND$ before it is passed to
this routine, you can find the command in the DWDOOR.INC file.
Syntax:
CALL DoorInit(COMMAND$)
Where COMMAND$ = The name of the CFG file to read.
= LOCAL or nothing.
= ? to display DoorHelp$
See Also: DoorInfo$()
Page 36
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DoorName$ String Full name of the door.
-------------------------------------------------------------------
You set this variable to the name of your program. It cannot be
more the 40 characters so don't get to wild with your program names!
You can find this variable in the DWDOOR.INC file.
Syntax:
DoorName$ = "DEMO Door for DWDoor v2.3"
See Also: DoorHelp$, ErrorFile$
Page 37
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ErrorFile$ String The filename to write errors to.
-------------------------------------------------------------------
Set this variable to the file name you wish to have the errors
printed to. You can find this variable in the DWDOOR.INC file.
Syntax:
ErrorFile$ = "DWDOOR.ERR"
See Also: DoorHelp$, DoorName$
Page 38
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ErrorLev% Function Returns SHELLed ERRORLEVEL occurred.
-------------------------------------------------------------------
This functions will return the ERRORLEVEL of a program SHELLed to
within a program after its execution, if used directly after the
SHELL statement.
Syntax:
A% = ErrorLev%
Example:
A$ = "WHATEVER.ZIP"
SHELL "PKUNZIP " + A$
A% = ErrorLev%
IF A% THEN
PRINT "Error"; A%; "occurred while trying to UNZIP "; A$
END IF
Page 39
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Exist%() Function A non-zero number if file exists.
-------------------------------------------------------------------
This function returns a non-zero number if the filename passed to it
exists. The filename may contain drive and path. Use this before
opening a file.
Syntax:
A% = Exist%(File$)
Where File$ = The filename you wish to use.
Example:
IF Exist%("WHATEVER.ZIP") THEN
PRINT "WHATEVER.ZIP exists, we can now UNZIP it!"
ELSE
PRINT "WHATEVER.ZIP can't be found!"
END IF
Page 40
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
ExitDoor() Subroutine Exits back to the BBS with ERRORLEVEL
-------------------------------------------------------------------
Use this function to end your program. It will close all files and
exit the program with an ERRORLEVEL if set to a non-zero number.
In UNREGISTERED versions of the DWDoor library, the screen will
clear and the DWDoor Copyright notice will be displayed for 5
seconds. Registering DWDoor will disable this function.
Syntax:
CALL ExitDoor(ErrorTyp%)
Where ErrorTyp% = The ERRORLEVEL to set in DOS after ending.
(This must be a positive number.)
See Also: WriteDoorERR()
Example:
CALL ExitDoor(1)
----------------
Batch file:
DOORNAME DOORNAME.CFG
IF ERRORLEVEL == 0 THEN EndBatch
Oops:
ECHO An error occurred in the door!
EndBatch:
Page 41
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Extra$ String Extra string of 70 characters or less
-------------------------------------------------------------------
This variable contains a sysop configurable string of 70 characters
or less that allows the sysop to personalize the door to the BBS
system the door would be running on. This string is passed through
the CFG file's EXTRA variable.
Syntax:
A$ = Extra$
See Also: EXTRA
Page 42
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
False% Integer Constant 0.
-------------------------------------------------------------------
This variable will always contain a 0. Used for testing.
Syntax:
A% = False%
See Also: True%
Page 43
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
FirstName$ String User's First name.
-------------------------------------------------------------------
This variable will contain the user's first name, in mixed case.
First character Upper case, the rest lower case. (eg: "John")
Syntax:
A$ = FirstName$
See Also: LastName$
Example:
PRINT "Hello "; FirstName$; ", welcome to the game!"
Page 44
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Fore% Integer Current foreground color.
-------------------------------------------------------------------
This variable contains the currently used foreground color.
Syntax:
A% = Fore%
See Also: Back%
Page 45
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
GetBaud&() Function Returns baud rate of opened com port.
-------------------------------------------------------------------
This function will return the current baud rate of the opened com
port.
Syntax:
A& = GetBaud&(C%)
Where C% = The current handle of the com port to use, it can be
a number from 1 to 8.
See Also: Carrier%(), ComPort%, Parity%(), DataLen%()
Example:
FOR X% = 1 TO 8
IF Carrier%(X%) THEN
PRINT "The baud rate of COM";
PRINT LTRIM$(STR$(X%)); ": is"; GetBaud&(X%)
END IF
NEXT
Page 46
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
GetExtra$() Function Gets user CFG variable information.
-------------------------------------------------------------------
This function will allow the programmer to make their own CFG
variables. Any CFG variable that does not belong in the DWDoor CFG
file, is saved in memory with it's information. To access the
information, use this function to return the variable's data.
Syntax:
A$ = GetExtra$("MINE")
See Also: CFG Information
Example:
TimesADay% = VAL(GetExtra$("TIMESADAY"))
UserPrompt$ = GetExtra$("USERPROMPT")
Page 47
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
GetLocalInfo Subroutine Gets info for local mode execution.
-------------------------------------------------------------------
This routine will ask the local user for their first and last name
if program was entered using the LOCAL command line switch.
Syntax:
CALL GetLocalInfo
See Also: DoorInit()
Page 48
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Help() Subroutine Displays DoorHelp$ if ? is used.
-------------------------------------------------------------------
This routine will print the file passed to it with a pause every 23
lines, and ask if user wishes to enter local mode. This is called
upon if the ? switch is used on the command line. This file is not
displayed to the remote user.
Syntax:
CALL Help(File$)
Where File$ = The file you wish to display, can contain ANSI
escape codes.
See Also: DoorInit()
Page 49
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
InComm$() Function Gets input from KB and Remote with
-------------------------------------------------------------------
Use this function to get input from the KB and the com port set with
Comm% with several options. See DEMO.BAS for complete examples.
Syntax:
A$ = InComm$(Atr%,Arglen%,NoRet%,Def$,OutHlt%,Ch$,Prompt$)
Where Atr% = Single integer color to print Prompt$
Arglen% = Length of input to accept, with options. See
Table below.
= 0 then length is from the end of the prompt to
the end of the screen with word-wrap.
= If positive input is displayed when entered.
= If negative input is not displayed.
NoRet% = See Table below.
Def$ = Default input is return is pressed alone.
OutHlt% = Single integer color to print text in.
Ch$ = Allowed input, if "" then any valid ASCII
alpha-numeric character is accepted.
Prompt$ = String to print before getting input.
┌─────────╥────────╥───┬───┬───┬───┬───┬───┬───┬───┐
│ ArgLen% ║ NoRet% ║ A │ B │ C │ D │ E │ F │ G │ H │
╞═════════╬════════╬═══╪═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│ =0 ║ =0 ║ * │ │ * │ │ * │ * │ │ │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ <0 ║ =0 ║ │ * │ │ * │ │ * │ │ * │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ <0 ║ <0 ║ │ * │ │ │ * │ │ * │ * │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ <0 ║ >0 ║ │ * │ │ │ * │ * │ │ * │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ >0 ║ =0 ║ │ │ * │ * │ │ * │ │ │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ >0 ║ <0 ║ │ │ * │ │ * │ │ * │ │
├─────────╫────────╫───┼───┼───┼───┼───┼───┼───┼───┤
│ >0 ║ >0 ║ │ │ * │ │ * │ * │ │ │
└─────────╨────────╨───┴───┴───┴───┴───┴───┴───┴───┘
A = Word wrap mode enabled, word wrapping occurs at column 77.
B = Input is hidden and not displayed when entering.
C = Display input as it is entered.
D = A RETURN is required to end input.
E = A RETURN is not required to end input, function will end when
Arglen% is reached.
F = Display a CRLF$ upon exiting routine.
G = Do not display a CRLF$ upon exiting routine.
H = Def$ = 1 character allowed to be displayed instead of input.
* = Above function occurs with this setting.
NOTE: Arglen% can be either positive or negative the length of
input to allow. NoRet% is either 0, -1, 1, or if =9876 then
C, D, and G are invoked. (Last minute change!)
See Also: Attr%(), OutComm()
Page 50
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
InText$ String Extra input from the user.
-------------------------------------------------------------------
This variable contains a list of the commands entered on a single
line through InComm$(). If a user separates commands with a semi-
colon, they are stacked up in this string and used the next time the
InComm$() function is called until this variable is empty, unless
display of text is turned off in the next call to InComm$(), then
this variable is set to a null string.
Syntax:
A$ = InText$
See Also: InComm$()
Page 51
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
IRQ$ Variable Contains IRQ number if set.
-------------------------------------------------------------------
This variable will contain the IRQ number if the user requested a
non-standard IRQ assignment in the CFG file.
Syntax:
A$ = IRQ$
See Also: CommInit$
Example:
IF IRQ$ <> "" THEN PRINT "The IRQ being used is "; IRQ$
Page 52
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
KBLocal% Integer -1 if LOCAL, 0 if at REMOTE.
-------------------------------------------------------------------
This variable is set to -1 if the user is at the keyboard or 0 if
the user is at remote.
Syntax:
A% = KBLocal%
See Also: False%, True%
Example:
IF KBLocal% THEN PRINT "This is being run locally!"
Page 53
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
KBTime& Long Integer KB time-out limit in seconds.
-------------------------------------------------------------------
This variable contains the amount of seconds allowed before KB
timeout is detected. To convert to minutes, simply divide by 60.
This variable is set by the KBTIME variable in the CFG file.
Syntax:
A& = KBTime&
See Also: KBTIME
Example:
A$ = CommKey$
Secs& = TIMER + KBTime&
WHILE A$ = ""
Tmp$ = Center$("Seconds until timeout:" + STR$(Secs& - TIMER)
CALL DVPrint(12, 1, Tmp$, 7)
A$ = CommKey$
WEND
Page 54
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
LBack$ 1-CHR String Local non-destructive backspace.
-------------------------------------------------------------------
This variable contains the 1 character string for a local non-
destructive backspace.
Syntax:
A$ = LBack$
See Also: RBack$
Example:
A$ = "Press a key"
B$ = STRING$(LEN(A$), LBack$)
PRINT A$;
A$ = INPUT$(1)
PRINT B$; "You have just pressed a key!"
Page 55
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
LBackSp$ 3-CHR String Local destructive backspace.
-------------------------------------------------------------------
This variable contains a 3 character string for a local destructive
backspace.
Syntax:
A$ = LBackSp$
See Also: RBackSp$
Example:
A$ = "Press a key"
B$ = STRING$(LEN(A$), LBackSp$)
PRINT A$;
A$ = INPUT$(1)
PRINT B$; "You have just pressed a key!"
Page 56
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
LastName$ String User's Last name.
-------------------------------------------------------------------
This variable contains the user's last name in mixed case. (e.g.:
"Doe")
Syntax:
A$ = LastName$
See Also: FirstName$, SysopF$
Example:
PRINT "Hello "; FirstName$; " "; LastName$
Page 57
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Line25 Subroutine Prints info about user and door.
-------------------------------------------------------------------
This is used to print info about the user and the door on lines 24
and 25. If you wish to print anything to this area, use DVPrint().
Syntax:
CALL Line25
See Also: DVPrint()
Page 58
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
MaxTime& Long Integer Maximum time in door allowed in secs.
-------------------------------------------------------------------
This variable contains the maximum amount of time allowed in the
program in seconds. This is set by MAXTIME variable in the CFG
file.
Syntax:
A& = MaxTime&
See Also: KBTime&
Page 59
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
More% Function More prompt with Yes, No, Continuous.
-------------------------------------------------------------------
This function will allow you to put a pause for more input from the
user in your program. It will print "More: (Y)es, (N)o, or
(C)ontinuous" and wait for a response from the user, then erase
itself and the user's input without moving down one line.
Syntax:
A% = More%
Where More% = -1 if Yes
= 0 if No
= 1 if Continuous
See Also: Pause
Example:
FF% = FREEFILE
OPEN "TEXTFILE.TXT" FOR INPUT ACCESS SHARED READ WRITE AS #FF%
PLine% = 0
WHILE NOT EOF(1)
LINE INPUT #FF%, PText$
INCR PLine%
IF NonStop% = True% THEN
PLine% = 0
END IF
IF PLine% < 23 THEN
CALL OutComm(7, 1, PText$)
ELSEIF PLine% >= 23
A% = More%
IF A% = False% THEN
CLOSE #FF%
EXIT LOOP
ELSEIF A% = 1 THEN
NonStop% = True%
END IF
END IF
WEND
CLOSE #FF%
Page 60
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
NormalColor$ 4-CHR String ANSI color code of white on black.
-------------------------------------------------------------------
By printing this string out to the screen or the user, you will
reset the colors to white on black. Only do this if Ansi% is -1.
Syntax:
A$ = NormalColor$
See Also: AnsiColor$(), Ansi%
Example:
A$ = AnsiColor$(Attr%(14, 4)) + "WARNING!" + NormalColor$
CALL CLR
CALL OutComm(7, 1, A$)
Page 61
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Okay% Integer -1 if serial code matches, 0 if not.
-------------------------------------------------------------------
This variable is set by you to show that the program is registered.
See the example of a serial code routine on page 5.
Syntax:
Okay% = -1
See Also: Serial$, SERIAL
Page 62
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
OutComm() Subroutine Prints string to screen and remote
-------------------------------------------------------------------
This routine will print a string out to the screen and the com port
if active and check time left, carrier drop, with various options.
Use this routine instead of PRINT #Comm%,Text$
Syntax:
CALL OutComm(Atr%,LF%,Text$)
Where Atr% = Single integer color attribute to print Text$.
LF% = -1 if a CR/LF is placed after Text$.
= 0 if no CR/LF is desired.
Text$ = The string to print.
See Also: CRLF$, InComm$()
Example:
Atr% = Attr%(14, 4)
LF% = True%
Text$ = "This is a test!"
CALL OutComm(Atr%, LF%, Text$)
Page 63
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Pause Subroutine Asks to "Press any key to continue."
-------------------------------------------------------------------
Asks user to "Press any key to continue: " and allows you to put a
pause anywhere you like in your program. Will erase itself without
moving down one line.
Syntax:
CALL Pause
See Also: More%
Page 64
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Parm$() Function Parses a string to any specified chrs
-------------------------------------------------------------------
This function will allow you to parse any string to it's various
elements separated by any character within a specified search string
which contains the character(s) that separate the main string.
Syntax:
A$ = Parm$(Main$, Separator$)
Where Main$ = The string to parse.
Separator$ = The characters to parse the string at.
(eg: " :;")
Example:
Main$ = "One Two,Three;Four:Five"
Sep$ = " ,;:"
WHILE Main$ <> ""
A$ = Parm$(Main$, Sep$)
PRINT A$
WEND
Page 65
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Parity%() Function Returns parity of ComPort%.
-------------------------------------------------------------------
This function will give you the parity of a com port. Will return 0
for NONE, 1 for ODD, and 2 for EVEN parity.
Syntax:
A% = Parity%(C%)
Where C% = The com port to use, and can be from 1 to 8.
See Also: Carrier%(), GetBaud&(), StopBits%()
Example:
FOR X% = 1 TO 8
IF Carrier%(X%) THEN
PRINT "The parity for COM"; LTRIM$(STR$(X%)); ": is ";
A% = Parity%(X%)
SELECT CASE A%
CASE 0
PRINT "None"
CASE 1
PRINT "Odd"
CASE 2
PRINT "Even"
END SELECT
END IF
NEXT X%
Page 66
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
PrintFile() Subroutine Prints entire file to user and screen
-------------------------------------------------------------------
This routine will print an entire file to the user with More%
prompting every 23 lines. It does support ANSI.
Syntax:
CALL PrintFile(Clr%, File$)
Where Clr% = -1 if you wish to clear the screen before
displaying the file.
= 0 if you do not wish to clear the screen first.
File$ = The filename you wish to be displayed. It can
contain ANSI codes.
See Also: More%
Example:
IF Ansi% = True% THEN
CALL PrintFile(-1, "BLTG")
ELSE
CALL PrintFile(-1, "BLT")
END IF
Page 67
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
RBack$ 1-CHR String Remote non-destructive backspace.
-------------------------------------------------------------------
This variable contains 1 character for non-destructive backspace for
remote.
Syntax:
A$ = RBack$
See Also: LBack$, LBackSp$, RBackSp$
Page 68
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
RBackSp$ 3-CHR String Remote destructive backspace.
-------------------------------------------------------------------
This variable contains 3 characters that define the remote
destructive backspace.
Syntax:
A$ = RBackSp$
See Also: LBack$, LBackSp$, RBack$
Page 69
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Script() Subroutine Enter all commands via text strings!
-------------------------------------------------------------------
This subroutine will allow you to access all the commands via a
simple text string. Each of the routines in this library is
accessible via this command.
Syntax:
CALL Script(Func$, InStr$, OutStr$)
Where Func$ = The name of the command, for example if you
wanted to access the OutComm() command, you
could do so by setting this variable to
"OutComm". To access the static CFG
variables, you can change them by setting
this value to "VARIABLE".
InStr$ = This is the optional variables (in string
format) for that command. For example, if
you were using the above OutComm() command,
this variable would contain the values for
this routine, in string format separated by
spaces. Numeric values are given as regular
numbers, whereas strings should be contained
in a double set of single quotes. An example
would look like this: "7 1 ''Hello World''"
(NOTE: Use a double set of single quotes '')
You can reset the value of any of the static
CFG variables, by setting this to the actual
line as it would appear in the CFG file.
(eg: "DOORFILE=PCBOARD.SYS")
OutStr$ = This is the value returned by the routine if
one is given.
Example:
InStr$ = "''This is a test!'' '' ''"
WHILE InStr$ <> ""
CALL Script("PARM", InStr$, OutStr$)
PRINT OutStr$
WEND
Page 70
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Scrn2Ansi$() Function Returns a specified window in ANSI.
-------------------------------------------------------------------
This function is a very versatile one in that it will allow you to
capture any part of the screen like a window, and convert it into
it's ANSI equivalent. You can draw your boxes on the screen before
hand, capture them with this command, and save them in a file for
later redisplaying on both the local and remote screens simply by
sending it out via OutComm(). Or while a user is playing their
game, and you don't want to mess up their display, capture the
portion of the screen with this command and display your text on top
of it and when they are finished, replace it via OutComm(). As you
can see, this function has alot of potential!
Syntax:
A$ = Scrn2Ansi$(X1%,Y1%, X2%,Y2%)
Where X1%,Y1% = The upper left corner coordinates of window.
X2%,Y2% = The lower right corner coordinates of window.
See Also: AnsiLocate$(), OutComm()
Example:
CALL PrintFile(-1, "SCRN.ANS")
OrgScrn$ = Scrn2Ansi$(9, 10, 12, 30)
CALL OutComm(14, 1, AnsiLocate$(9, 10) + "This is test line 1!"
CALL OutComm(14, 1, AnsiLocate$(10, 10) + "This is test line 2!"
CALL OutComm(14, 1, AnsiLocate$(11, 10) + "This is test line 3!"
A$ = INPUT$(1)
CALL OutComm(7, 0, OrgScrn$)
Page 71
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Serial$ String Returned from SERIAL in .CFG file.
-------------------------------------------------------------------
This variable it retrieved from the CFG files SERIAL variable for
use with your own serial code registration routines. See page 5 for
an example of such a routine.
Syntax:
A$ = Serial$
See Also: Okay%, SERIAL
Page 72
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
StopBits%() Function Returns stop-bits of ComPort%.
-------------------------------------------------------------------
This function will return the stop-bits setting from the a com port
number passed to it.
Syntax:
A% = StopBits%(C%)
Where C% = The com port number to use, can be a number from 1
to 8.
See Also: Carrier%(), DataLen%(), Parity%()
Example:
FOR X% = 1 TO 8
IF Carrier%(X%) THEN
PRINT "The stop bits for COM"; LTRIM$(STR$(X%)); ": is ";
PRINT StopBits%(X%)
END IF
NEXT X%
Page 73
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SysopF$ String The Sysop's First name.
-------------------------------------------------------------------
This variable contains the Sysop's first name in mixed case. This
is retrieved from the SYSOPF variable set in the CFG file.
Syntax:
A$ = SysopF$
See Also: FirstName$, LastName$, SysopL$, SYSOPF
Page 74
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SysopL$ String The Sysop's Last name.
-------------------------------------------------------------------
This variable contains the Sysop's last name in mixed case. This is
retrieved from the SYSOPL variable set in the CFG file.
Syntax:
A$ = SysopL$
See Also: FirstName$, LastName$, SysopF$, SYSOPL
Page 75
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SysopName$ UCASE String The Sysop's full name in Uppercase.
-------------------------------------------------------------------
This variable contains the Sysop's full name in uppercase.
Syntax:
A$ = SysopName$
See Also: SysopF$, SysopL$, UserName$
Page 76
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
TestComm Subroutine Tests com port, exits if carrier lost
-------------------------------------------------------------------
This routine will test to see if a carrier is present on the current
open comm port. If not, it will exit with an ERRORLEVEL = 7.
Syntax:
CALL TestComm
See Also: CheckTime
Page 77
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
TimeIn& Long Integer Time user started program in seconds.
-------------------------------------------------------------------
The time from midnight that the user started the program in seconds.
Use this in conjuction with TimeLeft& and TIMER to determine how
much time the user has left and divide by 60 to convert to minutes.
Syntax:
A& = TimeIn&
See Also: TimeLeft&, MaxTime&, KBTime&
Page 78
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
TimeLeft& Long Integer Total time left in door in seconds.
-------------------------------------------------------------------
The amount of time user has left in program in seconds before
program ends.
Syntax:
A& = TimeLeft&
See Also: TimeIn&, MaxTime&, KBTime&
Page 79
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
Trim$() Function Trims string of spaces on both ends.
-------------------------------------------------------------------
This function will trim the spaces off of either end of a string.
Syntax:
A$ = Trim$(Text$)
Where Text$ = The string to trim spaces from.
Example:
A$ = " This is a test! "
A$ = Trim$(A$)
Page 80
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
True% Integer Constant -1.
-------------------------------------------------------------------
This variable will always remain -1 and is used throughout
the library.
Syntax:
A% = True%
See Also: False%
Page 81
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
UserName$ UCASE String User's full name in Uppercase.
-------------------------------------------------------------------
This variable contains the full name of the user in uppercase
characters.
Syntax:
A$ = UserName$
See Also: SysopName$
Page 82
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
WriteDoorERR() Subroutine Writes and error out to ErrorFile$.
-------------------------------------------------------------------
This routine serves to offer some error trapping. Once called upon
it will open the file set in ErrorFile$, and print text out to the
file and end the program setting the ERRORLEVEL in Dos to the error
type.
Syntax:
CALL WriteDoorERR(ERRType%, Text$)
Where ERRType% = -1 is File sharing error in Text$ routine.
= -2 is File passed to DoorInfo$() not found.
= -3 is User ran out of time.
= -4 is File passed to DoorInit() not found.
= -5 is File passed to Help() not found.
= -6 is DOORFILE variable not declared in CFG.
= -7 is User dropped Carrier
= -8 is File passed to PrintFile() not found.
= -9 is Serial Code did not pass.
= 0 Write Text$ to ErrorFile$ and return.
> 0 Write Text$ to ErrorFile$ and exit
program with error specified.
Suggestion: By using this function you can keep a log by setting
Text$ to whatever you wish, and calling this routine
with an ERRTyp% of 0. It will return without exiting
back to DOS. If you set ErrorFile$ to a different
filename, you could keep multiple log files.
Example:
OrgErrFile$ = ErrorFile$
ErrorFile$ = "HISCORE.DAT"
CALL WriteDoorERR(0, UserName$ + " " + USING$("######", Score&))
ErrorFile$ = OrgErrFile$
Page 83
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
The CFG File:
The CFG file is required for EVERY door program you run.
The order of the variables is not important, but the variables
that do not have defaults are necessary for variable
declarations to occur.
The CFG file can be named anything you wish it to be named.
It is called on the command line for remote operations to
commence. Let's say your write a door named HONKY and you would
like the CFG you have be cute, you could name the CFG file to
MOFO.INT and use the following command to invoke your program:
HONKY MOFO.INT
The included file DWDOOR.CFG shows you how a CFG file can
look. As long as the variable is the first thing on the line in
uppercase, you can put anything else you want in the CFG file
and it will be ignored during reading.
Page 84
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
CFG Variable List
Name Description
---- -----------
BBSNAME - The full name of the BBS running the door.
COMPORT - The com port number to operate the door on.
DOORFILE - Door file to get user input from (Default=DIRECT).
EXTRA - Extra line that sysop can add to personalize the door
to the BBS system. (Optional)
KBTIME - Time before exiting for no input from user (Default=5
minutes).
MAXTIME - Maximum time allowed in the door (Default=Time left
on BBS).
SERIAL - Is your personal way of getting the programs serial
code from the sysop.
SYSOPF - The sysop's first name.
SYSOPL - The sysop's last name.
All variables in the CFG file are declared by placing them at
the beginning of the line and immediately follow them with an equals
sign "=" and the text they are to replace. Example:
EXTRA=This line is extra!
Page 85
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
BBSNAME CFG Variable The full name of the BBS.
-------------------------------------------------------------------
By setting this variable to your BBS's name you will be able to use
the BBS$ variable. Whatever is contained in the variable, goes into
the BBS$.
Syntax:
BBSNAME=Your BBS Name!
See Also: BBS$
Page 86
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
COMPORT CFG Variable The com port number to use.
-------------------------------------------------------------------
This variable tells the program which com port number to use for
communications. It can be a number from 1 to 8 and is passed to the
ComPort% variable. If the user has a non-standard com port address,
they should put an H in front of the 4 digit hexadecimal value of
the port address. This variable has NO DEFAULT! This variable
should only be used if the user is having trouble and their doorfile
is not sending the com port correctly.
Syntax:
COMPORT=2
COMPORT=H03F8
See Also: ComPort%
Page 87
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
DOORFILE CFG Variable BBS Door file to get user data.
-------------------------------------------------------------------
This variable contains the file and path name of the BBS door filew
to find the user information. If it set to DIRECT then theulti-node
information will be retrieved directly from the com port and thea
user will be asked for their full name. This is passed directly to
the DoorInfo$() routine. See DoorInfo$() for version information.me
If this variable is not found, DIRECT will be assumed. You can now
add environment variables to this value to make your door multi-node
capable without having to use separate CFG files. Simply place a
precentage symbol "%" before and after the environment variable
you wish to specify (eg: %PCBDRIVE%%PCBDIR%\PCBOARD.SYS would become
C:\PCB\PCBOARD.SYS if PCBDRIVE=C: and PCBDIR=\PCB).
This variable can contain the following information:
PCBOARD.SYS - For PCBoard systems.
USER.SYS - For PCBoard 15.0 systems.
CALLINFO.BBS - For older Wildcat systems.
DOOR.SYS - For GAP and newer Wildcat systems.
DORINFOx.DEF - For RBBS and QBBS systems.
CHAIN.TXT - For WWIV systems
UBBS.SYS - For Ultra BBS Systemsget information
SFDOORS.DAT - For SpitFIRE BBS Systems
AUNTIE.SYS - For Auntie BBS Systems
TRIBBS.SYS - For Tri-BBS Systems
DIRECT - To instruct the program to get information directly
from modem if BBS type isn't supported.
Syntax:
DOORFILE=C:\BBS\PCBOARD.SYS
Alternate method:
DOORFILE=%ENV1%%ENV2%\PCBOARD.SYS
Where ENV1 = Environment variable #1
ENV2 = Environment variable #2 and so on . . .
NOTE: The % symbol must come before and after the enviroment variable
name. Use the SET command in DOS to list environment variables.
See Also: DoorInfo$()
Page 88
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
EXTRA CFG Variable Extra line for personalizing.
-------------------------------------------------------------------
This variable allows the sysop to personalize the program with a
string of up to 70 characters that you have access to with the
Extra$ variable.
Syntax:
EXTRA=Support Shareware by supporting this door!
See Also: Extra$
Page 89
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
IRQ CFG Variable IRQ number for non-standard comports.
-------------------------------------------------------------------
This variable tells the program to use an alternate IRQ number for
users that are using a non-standard comport. This number can be a
number between 2 and 15. If the user doesn't need to use this
variable, it can be left out.
Syntax:
IRQ=3
See Also: COMPORT
Page 90
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
KBTIME CFG Variable Time before exiting for no input.
-------------------------------------------------------------------
This variable tells the program how long to wait for no input from
the user before kicking him out of the door automatically. This
variable is set to the minutes and is multiplied by 60 and stored in
the KBTime& variable. The default for this variable if not found in
the CFG is 5 minutes.
Syntax:
KBTIME=3
See Also: KBTime&
Page 91
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
MAXTIME CFG Variable Maximum time allowed in the door.
-------------------------------------------------------------------
This variable tells the program how long to allow the user in the
program before returning to DOS. This variable stores the time
given in minutes to the MaxTime& in seconds. If this variable is
not found in the CFG the default value is time left on the system.
You can also set this to 0 to do the same thing. If the DOORFILE
variable (see page 81) is set to DIRECT then it will default to 30
minutes.
Syntax:
MAXTIME=30
See Also: MaxTime&
Page 92
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SERIAL CFG Variable The program's serial code.
-------------------------------------------------------------------
This variable should not be included in your CFG file unless the
program is registered. This variable will store the information in
the Serial$ variable. By using it in conjuction with Okay% you will
have a way of retrieving a serial code information directly from the
sysop for that particular door. See page 5 for an example and
further discussion on serial code routines.
Syntax:
SERIAL=12345
See Also: Serial$, Okay%
Page 93
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SYSOPF CFG Variable The sysop's first name.
-------------------------------------------------------------------
This variable is the sysop's first name. It will stored the
information supplied into the SysopF$ in mixed case.
Syntax:
SYSOPF=John
See Also: SysopF$
Page 94
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
-------------------------------------------------------------------
SYSOPL CFG Variable The sysop's last name.
-------------------------------------------------------------------
This variable will set the SysopL$ variable to the sysop's last name
in mixed case.
Syntax:
SYSOPL=Doe
See Also: SysopL$
Page 95
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
Making Your Own CFG Variables
This is really easy to do. Let's say you write a door game that
requires that the sysop configure it to their own specifications.
For example's sake, let say we want to add 2 new variables to the
CFG file: TIMESADAY and USERPROMPT. Now, TIMESADAY is a numeric
variable, that tells the program how many times a day the user of
the program can play the game, and USERPROMPT is the text that
prompts the user to register this door. You would simply put in
your example CFG file (with your door game) the following lines in
ASCII text (NOTE: It may help to let them know ahead of time what
that variable is suppose to do!):
'How many times a user can play this game in one day
TIMESADAY=3
'User prompt for telling him to help register
' [---------------------------------------------------]
USERPROMPT=Please help register this door with the sysop!
The length of the text variables can be as long as you like, but
they must end with a CR/LF so it's safe to say that the length of
the text can be as long as one line minus the length of the variable
name and the equals sign. Since most text editors allow a line
length of about 79 characters, it would be safe to say that a good
length to give them to work with would be around 70 characters (that
gives you about 8 characters for a variable name.
Numeric values are saved as strings, if you wish to use them as
numeric, you will have to convert them using the VAL function in PB.
Getting the values with the GetExtra$() function is easy, here's
how you would handle the above examples in PB:
TimesPerDay% = VAL(GetExtra$("TIMESADAY"))
UserPrompt$ = GetExtra$("USERPROMPT")
or an alternative method:
DIM CFG$(2), Values$(2)
CFG$(1) = "TIMESADAY"
CFG$(2) = "USERPROMPT"
FOR X = 1 TO 2
Values$(X) = GetExtra$(CFG$(X))
NEXT
As you can see this can be very useful in making your programs
even more configurable than they already are and allow you to
maintain a sense of continuity throughout your door without you
having to do all the hard work!
NOTE: The environment variable method explained in the description of
DOORFILE on Page 88 does not work with user CFG variables at this
time.
Page 96
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
Author's Notes and Suggestions:
Here's a few helpful hints that will help you in your
programming.
■ If you want to open a file for reading data for your
program assign FREEFILE to a variable and use the variable
for your file functions.
EXAMPLE: A% = FREEFILE
OPEN "I", A%, Filename$
LINE INPUT #A%, A$
CLOSE #A%
■ If you wish to make a log, you can use the WriteDoorERR()
routine by setting the text you wish to print to a string
and calling the routine with an ERRTyp% of 0. The text
will be printed to the file you set in ErrorFile$.
EXAMPLE: ErrorFile$="USER.LOG"
Text$ = UserName$ + " played " + TIME$ + "."
CALL WriteDoorERR(0,Text$)
■ If you wish to update the display constantly without
having to sit and wait for a key to be pressed, use the
CommKey$ function and test whether or not the user has
pressed anything. If not, continue with what you were
doing, but if so... act on the result returned.
■ If your users are having difficulty setting up your door
ask them if your error file exists. If it doesn't then
the error occurred from something they did or did not do.
Ask if they are using the correct path and file name in
the DOORFILE variable of the CFG. If they are, suggest
they try using the DIRECT command. They do not need to
use the COMPORT variable when using a valid DOORFILE
value. If they are still having trouble, and you don't
know what's wrong... you can contact me on the PMS BBS at
(516) 737-4637. Those of you who register this door
library will have access to the Technical Support Voice
Line for problems of a more immediate nature.
■ Read the comments included in the enclosed DWDOOR.CFG demo
of what a CFG file should look like. It will give you a
better understanding of how the file can appear.
■ Look at the included source for the demo door program.
You will find examples of password protection, word
wrapping, cursor locating, color changing, fixed length
input, selective input, and how to end a program
correctly. I would have included a bunch more but thought
that the examples given were enough to get you started.
Page 97
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
■ The new Scrn2Ansi$() function will come in handy quite a
bit for ANSI intensive doors. You can just grab the
portion of the screen you want to display text over and
display the text over that area. Then when they are done,
send the captured screen portion back out to the modem to
replace what ever you destroyed. It's alot of fun!
Page 98
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
Error Messages:
You'll find that most users who are having programs will
report them to you and give you an error number and a prg-ctr
number. Most of the error numbers that I have received are as
follows:
25 DEVICE FAULT: [run-time error]
A hardware error has occurred, for example, with the printer
interface or a communications adapter. This occurs due to a
user fault, he probably specified the wrong port address or
an invalid com port number.
53 FILE NOT FOUND: [run-time error]
The file name specified could not be found on the indicated
drive. This is occurs probably due to a path not specified
correctly by the user or a drive letter that should be there
but was left out.
57 DEVICE I/O ERROR: [run-time error]
A serious hardware problem occurred when trying to carry out
some command. This can occur if they are trying to use a
faster modem speed than what they actually have. Have them
change it.
61 DISK FULL: [run-time error]
There isn't enough free space on the indicated or default
disk to carry out a file operation. Have them create some
more free disk space and retry your program.
67 TOO MANY FILES: [run-time error]
This error can be caused either by trying to create too many
files in a drive's root directory, or by an invalid file
name that affects the performance of the DOS Create File
system call. Have them increase their FILES= in CONFIG.SYS.
68 DEVICE UNAVAILABLE: [run-time error]
You tried to OPEN a device file on a machine without that
device; for example, COM1 on a system without a serial
adapter or modem. Have them check their com port number in
their drop file, if not have them set the COMPORT variable
in the CFG file.
75 PATH/FILE ACCESS ERROR: [run-time error]
During a command capable of specifying a path name (OPEN,
RENAME, or MKDIR, for example), you used a path
inappropriately; trying to OPEN a subdirectory or to delete
a directory in-use, for example. See Error 76 .
76 PATH NOT FOUND: [run-time error]
The path you specified during a CHDIR, MKDIR, OPEN, etc.,
can't be found. Have them check all their drive/path
information (sometimes they use the wrong drive letter or
forget to put a / at the end, etc.)
Page 99
PowerBASIC DWDoor Library v2.3
(C) Copyright 1993 - James R. Davis - All Rights Reserved
The prg-ctr number is cool because it tells you exactly
where the problem occured and PowerBASIC will take you to the
exact line number where the problem occured. This is a great
feature of PowerBASIC over QB. To go to the line that is giving
you the problem, when you first bring up the program in the PB
IDE, press ALT-C,F and type the number returned by the prg-ctr.
The program will recompile and the cursor will sit on the line
where the error occured. If you get a message saying that the
line cannot be displayed because the source cannot be found then
the problem occured within the library. But go through the
errors above and check them out before reporting it to me. More
than likely, it will be due to user error in drive/path or
comport number not specified correctly. If after all else has
failed, report the error number and prg-ctr number (along with
your source code for recompilation) and a description of when
the error occurred and the events that lead up to the error and
I will attempt to fix it. Call the PMS BBS at (516) 737-4637 to
do so.
Closing:
That about does it for these docs. I hope that you are able
to understand them pretty well. Even though my editor has given
me these stats;
Flesch Reading Ease: 72 (0=Hardest,100=Easiest)
Gunning's Fog Index: Grade Level 9 (8 to 10 best)
Flesch-Kincaid : Grade Level 6
I still have premonitions of those reading this and saying,
"HUH?" I hope that I covered everything and explained as much
as possible without overloading my editor (I'm up to 94% memory
used! ARGH!).
Have fun programming and I hope to see many new ideas coming
in the future! I would appreciate any suggestions you may have
on making this a better library for all your door programming
needs. You can contact me through the PowerBASIC conference of
the Intelec network as James Davis, or you can call the Home Of
DavisWARE - The Programmer's Mega-Source at (516) 737-4637!
Until next time buckroos...
-=> James "The Garf!" Davis! <=-
Page 100