home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- 'Total Control Systems QuickBasic 4.5
- '****************************************************************************
- '
- ' Program : FLINE.BAS
- ' Written by : Tim Beck
- ' Written On : 10-01-90
- ' Function : Print Function Key Line
- '
- '****************************************************************************
- ' 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 FUNCTION Show$ (msg$, msg.len%)
- DECLARE SUB ONSCREEN (row%, col%, msg$, csr%, attr%)
- DECLARE SUB PRINTA (xpos%, ypos%, attr%, msg$)
-
- DECLARE SUB F.LINE (Keys$())
-
- '----------------------------------------------------------------------
- ' Print Function Key Line at Row 25
- '
- ' Keys$() = Keys to Print at Bottom Row (24, 25)
- '
- '
- REM $INCLUDE: 'STDCOM.INC'
-
- TIMER OFF 'Enables Event Trapping
-
- SUB F.LINE (Keys$()) STATIC
-
- row% = 25
- num.keys% = UBOUND(Keys$)
- max.wid% = 0
- max.keys% = num.keys%
- key.cnt% = 0
-
- FOR ky% = 1 TO num.keys%
- IF LEN(Keys$(ky%)) > max.wid% THEN
- key.cnt% = ky%
- max.wid% = LEN(Keys$(ky%))
- ELSEIF LEN(Keys$(ky%)) > 0 THEN
- key.cnt% = ky%
- END IF
- NEXT ky%
-
- IF max.wid% = 0 THEN
- CALL ONSCREEN(25, 1, "", 0, HB.attr%)
- EXIT SUB
- ELSEIF key.cnt% < num.keys% THEN
- num.keys% = key.cnt%
- END IF
-
- IF num.keys% MOD 2 <> 0 THEN
- num.keys% = num.keys% + 1
- END IF
-
- Lin.wid% = (num.keys% * 2) + (num.keys% * max.wid%)
- IF Lin.wid% > 80 THEN
- Lin.wid% = Lin.wid% / 2
- max.keys% = num.keys% / 2
- row% = 24
- END IF
- IF Lin.wid% > 80 THEN
- spacer% = 80 - ((max.keys% * 2) + (max.keys% * max.wid%))
- ELSE
- spacer% = 0
- END IF
- DO
- spacer% = spacer% + 1
- LOOP UNTIL (max.keys% * 2) + (max.keys% * (max.wid% + spacer%)) > 80
- spacer% = spacer% - 1
- FOR R% = row% TO 25
- CALL ONSCREEN(R%, 1, "", 0, S.attr%)
- NEXT R%
- FOR ky% = 1 TO num.keys%
- xpos% = ((ky% - 1) * 2) + ((ky% - 1) * (max.wid% + spacer%)) + 1
- IF xpos% > 80 THEN
- xpos% = xpos% - 80
- END IF
- ypos% = row%
- CALL PRINTA(xpos%, ypos%, HB.attr%, "F" + RIGHT$(STR$(ky%), 1))
- CALL PRINTA(xpos% + 2, ypos%, S.attr%, Show$(Keys$(ky%), max.wid% + spacer%))
- IF ky% = max.keys% THEN
- row% = row% + 1
- END IF
- NEXT ky%
-
- END SUB
-
-