home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- 'Total Control Systems QuickBasic 4.5
- '****************************************************************************
- '
- ' Program : BANNER.BAS
- ' Written by : Tim Beck
- ' Written On : 10-01-90
- ' Function : BANNER SUBROUTINE
- '
- '****************************************************************************
- ' This program and those associated with it were written for use with Quick-
- ' Windows Advanced (Version 1.5+). Possesion of this program entitles you
- ' to certain priviliges. They are:
- '
- ' 1. You may compile, use, or modify this program in any way you choose
- ' provided you do not sell or give away the source code to this prog-
- ' ram or any of it's companions to anyone for any reason. You may,
- ' however, sell the resulting executable program as you see fit.
- '
- ' 2. You may modify, enhance or change these programs as you see fit. I
- ' as that you keep a copy of the original code and that you notify
- ' me of any improvements you make. I like to think that the code is
- ' bug free and cannot be improved upon, but I'm sure someone will
- ' find a way to make it better. If it's you, I'm looking forward to
- ' seeing your changes. I can be reached at:
- '
- ' Tim Beck Tim Beck (C/O Debbie Beck)
- ' 19419 Franz Road 8030 Fairchild Avenue
- ' Houston, Texas 77084 Canoga Park, California 91306
- ' (713) 639-3079 (818) 998-0588
- '
- ' 3. This code has been tested and re-tested in a variety of applications
- ' and although I have not found any bugs, doesn't mean none exist. So,
- ' this program along with it's companions comes with NO WARRANTY,
- ' either expressed or implied. I'm sorry if there are problems, but
- ' I can't be responsible for your work. I've tried to provide a safe
- ' and efficient programming enviroment and I hope you find it helpful
- ' for you. I do, however, need to cover my butt!
- '
- ' I have enjoyed creating this library of programs and have found them to be
- ' a great time saver. I hope you agree.
- '
- ' Tim Beck //
- '
- '****************************************************************************
- DECLARE SUB PCENTER (R%, C1%, C2%, msg$, attr%)
- DECLARE SUB BANNER (Row%, L.Side$, Center$, R.Side$, LType%)
-
- '------------------------------------------------------------------------
- ' Print a Banner on the Screen
- '
- ' ie: ======================================
- ' Left Text Center Text Right Text
- ' ======================================
- '
- ' Row% = Bottom Row of Banner
- ' L.Side$ = Left Side Text
- ' Center$ = Center Text
- ' R.Side$ = Right Side Text
- ' LType% = Line Type (0 = No Line, 1 = Single Line, 2 = Double Line)
- '
-
-
- REM $INCLUDE: 'STDCOM.INC'
-
- TIMER OFF 'Enables event trapping
-
- ' ON ERROR GOTO ErrorTrap
-
- ErrorTrap:
-
- ' RESUME
-
-
- SUB BANNER (Row%, L.Side$, Center$, R.Side$, LType%) STATIC
-
- L.Bord% = SCREEN(Row%, 1)
- R.Bord% = SCREEN(Row%, 80)
-
- IF LType% = 0 THEN
- B.Line% = 32
- ELSEIF LType% = 1 THEN
- B.Line% = 196
- ELSE
- B.Line% = 205
- END IF
-
- IF L.Bord% = 186 THEN
- IF LType% = 1 THEN
- L.Bord% = 199
- ELSE
- L.Bord% = 204
- END IF
- END IF
-
- IF R.Bord% = 186 THEN
- IF LType% = 1 THEN
- R.Bord% = 182
- ELSE
- R.Bord% = 185
- END IF
- END IF
-
- IF LEN(L.Side$) THEN
- CALL PRINTA(2, Row%, S.attr%, L.Side$)
- END IF
-
- IF LEN(Center$) THEN
- CALL PCENTER(Row%, 2 + LEN(L.Side$), 80, Center$, S.attr%)
- END IF
-
- IF LEN(R.Side$) THEN
- CALL PRINTA(80 - LEN(R.Side$), Row%, S.attr%, R.Side$)
- END IF
-
- CALL PRINTA(1, Row% + 1, S.attr%, CHR$(L.Bord%) + STRING$(78, B.Line%) + CHR$(R.Bord%))
-
- END SUB
-
-