home *** CD-ROM | disk | FTP | other *** search
- Release 01/04/91
-
- ================================================================================
- MdmComm - Modem Communications, a QuickBasic and Turbo Pascal Door Routine
- By Darrell Ericson at Dare Devil BBS (603)429-2915 v1.00
- ================================================================================
- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-
- o What IS MdmComm? MdmComm is a modem communication door routine.
- It is used for programmers who wish to write door games,
- but do not really want to spend the time fooling with the
- communications work. MdmComm is a very simple communications
- program. I "whipped" this up in approximately no time, and
- expect it to reflect my work. <Grin> It currently only supports
- Com1. For door info files, it only supports DORINFO1.DEF
- (QBBS/RBBS). I plan to come out with a new version (v2.00) in
- the future, which will support more Com ports. Future versions
- will possibly also support more door info files. Possibly later
- versions will also have routines for C and C++ programming.
-
- o WHY was MdmComm?
- MdmComm was "whipped up" in a few hours, because there
- did not seem to be any other modem Communications programs out
- there. I was sick and tired of trying to fool around and make
- trash work, Turbo Pascal did not have any built in Communications
- stuff, so I wrote a few routines in Assembly Language and called
- them from Turbo Pascal, which seems to work out pretty good.
- There are only basic communications stuff with MdmComm,
- currently, but it's better than nothing. Hopefully with the
- stuff there you will be able to write something decent. :)
-
- o Legal stuff:
- IF you use MdmComm, you are using it at your own risk. I
- do not guarantee anything. It works here, that's all I can say!
- If you have any problems, contact my board at (603)429-2915.
- Dare Devil BBS, and we will see what we can work out.
-
- o Registering MdmComm:
- Registering MdmComm is ONLY $15! What a deal! In
- MdmComm, nothing is disabled by not registering. By registering,
- that short pause at the beginning will be removed, and, you will
- make me happy. If you have problems with MdmComm,you are much
- more likely to get me to fix them if you have registered it.
-
- o About the author:
- I am Darrell Ericson of Dare Devil BBS (603)429-2915, I
- live in Amherst, NH, and have lived here for 14 years. I have
- been programming for approximately a year. I got my first modem
- in Januaray of '90, and set up a BBS in Feb. of '90. I have been
- running a board ever since! My first programming language was
- Microsoft's QuickBasic 4.5, second I programmed in Borlands Turbo
- Pascal 6.0, third I took a course on Assembly Language at Hesser
- College in Nashua, NH. After that I have been slowly using C,
- and C++. My favorite language by far is Borlands Turbo Pascal,
- which I often mix with assembly language, as I did in MdmComm. I
- was born August 4th, 1976, and currently am 15 years old. I
- program whenever I have time, which is not often. Some sports I
- am into are biking, I am a member of the GSW (Granite State
- Wheelmen), and I enjoy cross country running (5+ miles). I am a
- freshman at MASH (Milford Area Senior High) in Milford, NH. I am
- looking for some type of programming job, but am still kind of
- young. Maybe next year. :)
-
- o MdmComm Supports the following calls from Borlands Turbo Pascal 6.0:
- Procedure InitComm;
- Procedure DeInitComm;
- Procedure ShowChar(Msg: String);
- Procedure ShowCr(Msg: String);
- Function UserKey: Char;
- Function ReadChar(MaxChars: Byte): String;
- Function Ready: Boolean;
-
- Procedure ClearKey;
- Procedure ClrScrn;
- Procedure AnyKey;
- Procedure ShowFile(FileName: String);
- Procedure Pause(Secs: Byte);
-
- o MdmComm Supports the following calls from Microsoft QuickBasic 4.5:
- SUB ClearKey ()
- SUB ShowFile (FileName$)
- SUB AnyKey ()
- SUB ClrScrn ()
- SUB Delay (Num!)
- SUB InitComm ()
- SUB DeInitComm ()
- SUB ShowChar (Msg$)
- SUB ShowCr (Msg$)
- FUNCTION ReadChar$ (Num!)
- FUNCTION UserKey$ ()
-
- o MdmComm Supports the following calls from Microsoft Basic 7.1:
- SUB ClearKey ()
- SUB ShowFile (FileName$)
- SUB AnyKey ()
- SUB ClrScrn ()
- SUB Delay (Num!)
- SUB InitComm ()
- SUB DeInitComm ()
- SUB ShowChar (Msg$)
- SUB ShowCr (Msg$)
- FUNCTION ReadChar$ (Num!)
- FUNCTION UserKey$ ()
-
- o MdmComm has declared the following variables for you to use in
- Borlands Turbo Pascal 6.0:
- Remote: Boolean;
- Graphics: Boolean;
- Baud: Word;
- UserName: String[30];
- TimeLeft: Word;
-
- o MdmComm has declared the following variables for you to use in
- Microsoft QuickBasic 4.5:
- True = -1, False = 0
- Modem = 1
- BBSName String * 30
- SysOpName String * 30
- UserName String * 30
- UserCity String * 30
- Graphics Integer
- Remote Integer
- Graphics Integer
-
- o MdmComm has declared the following variables for you to use in
- Microsoft Basic 7.1:
- True = -1, False = 0
- Modem = 1
- BBSName String * 30
- SysOpName String * 30
- UserName String * 30
- UserCity String * 30
- Graphics Integer
- Remote Integer
- Graphics Integer
-
- o Usage of Turbo Pascal Procedures and Functions:
- Procedure InitComm;
- Objective: Initialize Modem, and read in dorinfo1.def
- Example: InitComm;
- Comments: This must be run before anything else.
-
- Procedure DeInitComm;
- Objective: Nothing
- Example: DeInitComm;
- Comments: This is just for compatibility with QB's version
-
- Procedure ShowChar(Msg: String);
- Objective: Display a string to com port and local screen
- without crlf appending string.
- Example: ShowChar(AnsiBBlue+'Hello!'+AnsiBWhite);
- Comments: See ShowCr
-
- Procedure ShowCr(Msg: String);
- Objective: Display a string to com port and local screen
- with crlf appending string.
- Example: ShowCr('MdmComm is great.');
- Comments: See ShowChar
-
- Function UserKey: Char;
- Objective: Read one character from com port or local keyboard
- with wait.
- Example: Ch := UserKey;
- Comments: Reads one character and does not wait for
- an enter key. There is no time out.
-
- Function ReadChar(MaxChars: Byte): String;
- Objective: Read in a string of characters from com port
- or local keyboard.
- Example: String1 := ReadChar(10);
- Comments: Reads and echos characters, extended
- input (backspace works to delete chars)
-
- Function Ready: Boolean;
- Objective: Return if characters are waiting from
- com port or local keyboard.
- Example: If (Ready) then ShowCr('Chars are waiting!');
- Comments: None
-
- Procedure ClearKey;
- Objective: Clears all waiting characters from
- com port and local keyboard.
- Example: ClearKey;
- Comments: None
-
- Procedure ClrScrn;
- Objective: Clear screen for user through com port
- and local screen.
- Example: ClrScrn;
- Comments: None
-
- Procedure AnyKey;
- Objective: Prompt the user for Press [Any Key] To Continue...
- and wait for a key to be pressed.
- Example: AnyKey;
- Comments: shift and numlock, etc. Do not count as keys
- to be pressed.
-
- Procedure ShowFile(FileName: String);
- Objective: Show a file to the local user and remote user
- Example: ShowFile('THISFILE.TXT');
- Comments: It does not pause after each screen. Beware
- for long files.
-
- Procedure Pause(Secs: Byte);
- Objective: Delay the computer a bit.
- Example: Pause(1);
- Comments: 1 = 1 second, 2 = 2 seconds, etc. Max = 255 seconds.
-
- ===============================================================================
- | End of Usage of Turbo Pascal Procedures and Functions. |
- ===============================================================================
-
- o Usage of Microsoft QuickBasic 4.5 Subs and Functions:
- SUB ClearKey ()
- Objective: Clears all waiting characters from com port
- and local keyboard.
- Example: ClearKey
- Comments: None
-
- SUB ShowFile (FileName$)
- Objective: Display a .ASC/.ANS file to local screen and
- com port.
- Example: ShowFile("MDMCOMM1")
- Comments: If user has graphics it will show .ANS, otherwise
- .ASC
-
- SUB AnyKey ()
- Objective: Prompt user Press [Any Key] To Continue, and
- wait for keypress from com port or local
- keyboard.
- Example: AnyKey
- Comments: Shift and Numlock, etc. Do not count as keys.
-
- SUB ClrScrn ()
- Objective: Clears screen for user through com port and
- local screen.
- Example: ClrScrn
- Comments: It might help to have ansi.
-
- SUB Delay (Num!)
- Objective: Delays the computer a bit.
- Example: Delay(7)
- Comments: Delay 1 will delay 1 sec, delay 7, 10 secs, etc.
- Depending on computer.
-
- SUB InitComm ()
- Objective: Initialize Communications and read Dorinfo1.Def
- Example: InitComm
- Comments: This should proceed all other commands of MdmComm.
- Initializing the communications opens
- Com1 as file #1, so do not use file handle 1
- if you are using MdmComm.
-
- SUB DeInitComm ()
- Objective: Deinitialize Communications
- Example: DeInitComm
- Comments: This should be run last, MdmComm stuff does not
- work after this.
-
- SUB ShowChar (Msg$)
- Objective: Shows a string of characters to the com port
- without appending a crlf.
- Example: ShowChar("Hello!!!")
- Comments: See ShowCr
-
- SUB ShowCr (Msg$)
- Objective: Shows a string of characters to the com port
- appending it with a crlf
- Example: ShowCr("MdmComm is great.")
- Comments: See ShowChar
-
- FUNCTION ReadChar$ (Num!)
- Objective: Read in characters from com port and
- local keyboard.
- Example: String1$ = ReadChar$(10)
- Comments: It uses extended input, backspace works.
-
- FUNCTION UserKey$ ()
- Objective: Read in one character from com port or local
- keyboard.
- Example: Ch$ = UserKey$
- Comments: Returns one character, with wait
-
- ===============================================================================
- | End of Usage of Microsoft QuickBasic 4.5 Subs and Functions |
- ===============================================================================
-
- o Usage of Microsoft Basic 7.1 Subs and Functions:
- SUB ClearKey ()
- Objective: Clears all waiting characters from com port
- and local keyboard.
- Example: ClearKey
- Comments: None
-
- SUB ShowFile (FileName$)
- Objective: Display a .ASC/.ANS file to local screen and
- com port.
- Example: ShowFile("MDMCOMM1")
- Comments: If user has graphics it will show .ANS, otherwise
- .ASC
-
- SUB AnyKey ()
- Objective: Prompt user Press [Any Key] To Continue, and
- wait for keypress from com port or local
- keyboard.
- Example: AnyKey
- Comments: Shift and Numlock, etc. Do not count as keys.
-
- SUB ClrScrn ()
- Objective: Clears screen for user through com port and
- local screen.
- Example: ClrScrn
- Comments: It might help to have ansi.
-
- SUB Delay (Num!)
- Objective: Delays the computer a bit.
- Example: Delay(7)
- Comments: Delay 1 will delay 1 sec, delay 7, 10 secs, etc.
- Depending on computer.
-
- SUB InitComm ()
- Objective: Initialize Communications and read Dorinfo1.Def
- Example: InitComm
- Comments: This should proceed all other commands of MdmComm.
- Initializing the communications opens
- Com1 as file #1, so do not use file handle 1
- if you are using MdmComm.
-
- SUB DeInitComm ()
- Objective: Deinitialize Communications
- Example: DeInitComm
- Comments: This should be run last, MdmComm stuff does not
- work after this.
-
- SUB ShowChar (Msg$)
- Objective: Shows a string of characters to the com port
- without appending a crlf.
- Example: ShowChar("Hello!!!")
- Comments: See ShowCr
-
- SUB ShowCr (Msg$)
- Objective: Shows a string of characters to the com port
- appending it with a crlf
- Example: ShowCr("MdmComm is great.")
- Comments: See ShowChar
-
- FUNCTION ReadChar$ (Num!)
- Objective: Read in characters from com port and
- local keyboard.
- Example: String1$ = ReadChar$(10)
- Comments: It uses extended input, backspace works.
-
- FUNCTION UserKey$ ()
- Objective: Read in one character from com port or local
- keyboard.
- Example: Ch$ = UserKey$
- Comments: Returns one character, with wait
-
- ===============================================================================
- | End of Usage of Microsoft Basic 7.1 Subs and Functions |
- ===============================================================================
-
- ================================================================================
- MdmComm - Modem Communications, a QuickBasic and Turbo Pascal Door Routine
- By Darrell Ericson at Dare Devil BBS (603)429-2915 v1.00
- ================================================================================
- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-
- Example (QuickBasic 4.5):
- ~~~~~~~
- '$INCLUDE:'MDMCOMM.BI'
- InitComm
- ShowCr(AnsiBBlue+"H"+AnsiBWhite+"e"+AnsiYellow+"l"+AnsiBBlue+"l"+AnsiWhite+"o")
- DeInitComm
-
- Example (Basic 7.1):
- ~~~~~~~
- '$INCLUDE:'MDMCOMM.BI'
- InitComm
- ClrScrn
- ShowCr(AnsiYellow+"What's up, doc?")
- DeInitComm
-
- Example (Borlands Turbo Pascal 6.0):
- ~~~~~~~
- Program Example1;
-
- Uses MdmComm;
-
- Begin
- InitComm;
- ShowChar('Welcome to MdmComm, ', UserName, '...');
- DeInitComm;
- End.
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Extra Notes
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- o MdmComm was WHIPPED up:
- MdmComm is not very refined or awesome yet, it was
- WHIPPED UP over a few hours. It could use A LOT more work. If
- anyone has any problems, or wants me to make some certain changes
- to it, read in a different BBS type, or ANYTHING - call my board
- and let me know. That's Dare Devil BBS (603)429-2915! I will
- change just about anything-- Especially if you are one who has
- registered.
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- End of documentation
- ~~~ ~~ ~~~~~~~~~~~~~