Jdibas 1/5

 BBS: Inland Empire Archive
Date: 05-30-92 (12:30)             Number: 133
From: JEFF FREEMAN                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Jdibas                1/5      Conf: (2) Quik_Bas
This message was from JEFF FREEMAN to ALL,
originally in conference (V) V-TREK
and was forwarded to you by JEFF FREEMAN.
                    -------------------------

Well... I have my TWIT filter working and the echoes are a much happier
place to be.

I have completely rewritten my door routines and set 'em up to compile
with QBSer21.

Qb Serial also comes with QBX object files, so you can write
doors using my routines, QBSerial and your choice of either QuickBASIC
4.x or BASIC 7.x (PDS).

The really neat thing about these routines is that they make sense.
JPRINT instead of PRINT, JINPUT instead of INPUT, JLOCATE, JCOLOR, etc.
I've speeded them up CONSIDERABLE just by eliminating redundant code.
With QBSerial they will support up to 115,200 bps and COM1-4.  QBSerial
also supports non-standard Ports and IRQ's.  It's *REALLY* sharp.

Okay, so the next zillion posts are gonna be my routines.  Catch 'em
now... these are too large to keep posting every month or so.


'$INCLUDE: 'QBSERIAL.DEC'
DEFINT A-Z
DECLARE SUB JCenter (T$, CRLF)
DECLARE SUB ViewFile (F$, MorePrompts)
DECLARE SUB JLines (L)
DECLARE SUB JCls ()
DECLARE FUNCTION JInKey$ ()
DECLARE FUNCTION JRND (Lo, Hi)
DECLARE FUNCTION JTrim$ (T$)
DECLARE SUB JBeep ()
DECLARE FUNCTION MORE$ ()
DECLARE SUB HitAKey ()
DECLARE SUB JInPut (P$, In$, W)
DECLARE SUB BackSpace (N)
DECLARE FUNCTION NCase$ (Name$)
DECLARE SUB JLocate (R, C)
DECLARE SUB OpenDorinfo (DF$)
DECLARE SUB CloseDoor ()
DECLARE FUNCTION JEXIST (F$)
DECLARE SUB JColor (FC, Bc)
DECLARE SUB JOpen (F$, Mode$, FileNum, RecLen)
DECLARE SUB OpenCom (ComPort, Baud&)
DECLARE SUB JPrint (T$, CRLF)
TYPE JDIType
  BBSName       AS STRING * 25  'name of BBS running door
  SysopName     AS STRING * 25  'name of sysop
  PlrName       AS STRING * 25  'name of current player
  Sysop         AS INTEGER      'True if player is the sysop
  Ansi          AS INTEGER      'False if player doesn't have ANSI
  SecLevel      AS INTEGER      'player's security level on the BBS
  AllCaps       AS INTEGER      'force input from user into all caps
  MoreFc        AS INTEGER      'foreground color of more prompt
  MoreBc        AS INTEGER      'background color of more prompt
  MoreMsg       AS STRING * 30  'the more prompt
  Pauses        AS INTEGER      'False = No more prompts
  HitKeyFc      AS INTEGER      'foreground color of hit-a-key prompt
  HITKeyBc      AS INTEGER      'background color of hit-a-key prompt
  HitKeyMsg     AS STRING * 30  'the hit-a-key prompt
  EchoMode      AS INTEGER      '0=normal, -1 = echo off, 1 = echo EchoChar
  EchoChar      AS STRING * 1   'The character to echo
  LineCount     AS INTEGER      'current line
  TimeOut       AS INTEGER      'soon to be users time left from BBS
  FC            AS INTEGER      'current foreground color
  Bc            AS INTEGER      'current background color
  FileExists    AS INTEGER      'True/False used by JEXIST
  EFNum         AS INTEGER      'file number used by JEXIST
  IsLocal       AS INTEGER      'True if local-mode else False
  LFNum         AS INTEGER      'scrn (local) file number
  TU            AS INTEGER      'time-up variable
END TYPE

CONST Black = 0, Red = 1, Green = 2, Yellow = 3, Blue = 4
CONST Cyan = 6, White = 7, bold = 8, Blink = 16, Magenta = 5
CONST False = 0, True = NOT False

COMMON SHARED JDI AS JDIType
LOCATE , , 1
'ON ERROR GOTO ErrorInDoor

  JDI.MoreFc = White + bold
  JDI.HitKeyFc = Yellow + bold
  JDI.MoreMsg = "[MORE?]"
  JDI.Pauses = True       'set this to True if you want pauses
  JDI.HitKeyMsg = "*-- Hit a key to continue --*"
  JDI.EchoChar = "*"

'************************Your door goes below this line****************
OpenDorinfo (COMMAND$)
JCls
JColor Red, Black
JPrint "This should be displayed both local and remote!", True
JColor Red, Black
JInPut "", K$, -4
JLines 5
HitAKey
JCls
JLines 3
JPrint "Very Nice!", True
JLines 5
JColor White, Black
ViewFile "JDI20", True

'***********************Your door goes above this line*****************
ErrorInDoor:
  CloseDoor

FileNotFound:
  JDI.FileExists = False
  RESUME NEXT

SUB BackSpace (N)
  BSpace$ = CHR$(8) + CHR$(32) + CHR$(8)
  FOR X = 1 TO N
        BS$ = BS$ + BSpace$
  NEXT X
  JPrint BS$, False
END SUB

SUB CloseDoor
IF NOT JDI.IsLocal THEN CloseComm
CLOSE
SYSTEM
END SUB

SUB HitAKey
        FC = JDI.FC
        Bc = JDI.Bc
        JColor (JDI.HitKeyFc), (JDI.HITKeyBc)
        JInPut JDI.HitKeyMsg, K$, 0
        K$ = UCASE$(JInKey$)
        JColor FC, Bc
        BackSpace LEN(RTRIM$(JDI.HitKeyMsg)) + 1
END SUB

SUB JBeep
JPrint CHR$(7), False
END SUB
>>> Continued to next message


---
 * Origin: Camelot BBS - Dallas, TX - (214) 339-8283 (1:124/1011)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET