Dec 172017
 
Create professional data entry screens with these CALLable QB routines.
File BASCREEN.ZIP from The Programmer’s Corner in
Category BASIC Language
Create professional data entry screens with these CALLable QB routines.
File Name File Size Zip Size Zip Type
SCREEN.BAS 6637 1018 deflated
SCREEN.DOC 6619 2579 deflated
TPCREAD.ME 199 165 deflated

Download File BASCREEN.ZIP Here

Contents of the SCREEN.DOC file


Subroutines SCREENS, SCREENI, SCREENF - Documentation
-----------------------------------------------------

Note: Even though this subroutine was specifically written and tested in
MS QUICKBASIC 3.0 and 4.0, it could probably be used in TURBO BASIC
as well with little or no modifications. To use it in BASICA, however,
extensive modifications would have to be done.

1) Overview
--------

The 3 subroutines SCREENS, SCREENI, and SCREENF let you create
professional data entry screens. You can set up as many fields as can fit
on one screen. SCREENS, SCREENI, and SCREENF are for string, integer, and
single precision type fields respectively. Each call to any of those
subroutines sets up a field on the screen in inverser video, positions the
cursor to the beginning of the field, and waits for data to be entered. As
soon as the field is filled with data, the subroutine returns to the
calling program, which may then call one of the subroutines again for a
different field. Pressing the ENTER key or the Tab or Shift Tab keys will
also cause the subroutine to return to the calling program. The left and
right arrow keys and the backspace key may be used to move the cursor
while still in the field. Pressing Esc ends the program. The position of
the field on the screen, it's width and color are specified as parameters
passed to the subroutine. It is also possible to initialize the field with
some value which may then be changed by the user. If you have DBASE III
(tm), you may make use of a special program SED that comes with DBASE III
(tm). SED actually lets you design the screen on your monitor, and then
creates DBASE (tm) code for you. You may then use my program BSED, which
converts the DBASE (tm) code generated by SED, into QUICKBASIC code. BSED
is distributed to all registered users of SCREEN.

2) Description of parameters: See actual coding example in next section.


Notes: a) All parameters ending with a % must be passed as integer type
variables or constants.
b) All values for foreground and background colors must conform
to the rules specified in the description of the COLOR
statement for text mode in your BASIC manual for the type of
monitor you are using. If you have a monochrome monitor, or
if you are not familiar with the various color codes, then
the following is the safest to use: 7 (white) for foreground
colors, and 0 (black) for background colors. Use the opposite
for highlighting foreground and background colors (0, 7).
Incorrect color values may yield unpredictable results.
c) All values for row and column must be within the limits of the
number of rows and columns of your monitor. Most monitors have
80 columns and 24 rows.

ROWX%, COLX% - Row and column of field on the screen

WID% - the width of the field

VAR - the variable that will receive the data entered in the
field. must be string, integer or single precision type
depending if it is used in STRINGS, STRINGI OR STRINGF.

FG%, BG% - Normal foreground and background color. Field will be in
inverse video (foreground and background colors reversed)

3) Coding example:

DECLARE SUB SCREENI (ROWX%, COLX%, WID%, VAR%, FG%, BG%)
DECLARE SUB SCREENF (ROWX%, COLX%, WID%, VAR!, FG%, BG%)
DECLARE SUB SCREENS (ROWX%, COLX%, WID%, VAR$, FG%, BG%)

REM CLEAR THE SCREEN, THEN DISPLAY THE FIELD DESCRIPTIONS ON THE SCREEN.

CLS
LOCATE 1, 1
PRINT "MONTH OF BIRTH"
LOCATE 3, 1
PRINT "DAY OF BIRTH"
LOCATE 5, 1
PRINT "YEAR OF BIRTH"
LOCATE 7, 1
PRINT "NAME"
LOCATE 9, 1
PRINT "HOURLY RATE"

REM THE FOLLOWING CALLS TO SCREENS FILL THE FIELDS WITH BLANKS IN INVERSE
REM VIDEO. SINCE THE 1ST PARAMETER (ROWX) IS NEGATIVE, NO DATA ENTRY IS
REM EXPECTED AT THIS POINT

STARTDATA:
CALL SCREENS(-1, 56, 2, " ", 7, 0)
CALL SCREENS(-3, 56, 2, " ", 7, 0)
CALL SCREENS(-5, 56, 4, " ", 7, 0)
CALL SCREENS(-7, 56, 20, SPACE$(20), 7, 0)
CALL SCREENS(-9, 56, 5, SPACE$(5), 7, 0)

REM IN ALL THE FOLLOWING SCREEN CALLS, ROWX (L% IN THIS CASE) IS FIRST SET
REM TO THE ROW VALUE BEFORE THE CALL STATEMENT. SINCE THE SUBROUTINE CHANGES
REM THE VALUE OF L% TO 51 IF Shift Tab WAS PRESSED, THE FOLLOWING LOGIC
REM WILL MAKE IT GO BACK TO THE PREVIOUS FIELD IN THAT CASE. AT THE 1ST
REM FIELD IT WILL BEEP IF Shift Tab WAS PRESSED, THEN CALL SCREEN AGAIN FOR
REM THE 1ST FIELD. NOTE THAT SCREENI IS CALLED FOR INTEGER FIELDS MON%, DAY%
REM AND YEAR%. SCREENS IS CALLED FOR STRING FIELD NAME$, AND SCREENF IS CALLED
REM FOR SINGLE PRECISION FIELD HOURATE!.

R1: L% = 1
CALL SCREENI(L%, 56, 2, MON%, 7, 0)
IF L% = 51 THEN BEEP: GOTO R1
R3: L% = 3
CALL SCREENI(L%, 56, 2, DAY%, 7, 0)
IF L% = 51 THEN GOTO R1
R5: L% = 5
CALL SCREENI(L%, 56, 4, YEAR%, 7, 0)
IF L% = 51 THEN GOTO R3
R7: L% = 7
CALL SCREENS(L%, 56, 20, NAME$, 7, 0)
IF L% = 51 THEN GOTO R5
R9: L% = 9
CALL SCREENF(L%, 56, 5, HOURATE!, 7, 0)
IF L% = 51 THEN GOTO R7

REM ROUTINE FOR PROCESSING THE DATA SHOULD BE CODED HERE, WHEN DONE
REM GO BACK TO DISPLAY ANOTHER SCREEN, AND RECEIVE DATA.

GOTO STARTDATA

To use this subroutine from your program, you must do one of the following:
a) Merge the source SCREEN.BAS to your program.
b) Compile the source separately, and put it on a Library (.LIB) or
Quicklibrary (.QLB). In QUICKBASIC 3.0 put it on a Userlibrary.
See your QUICKBASIC manual for details.

If you are satisfied with this software, please send a check or money
order for $20.- (U.S. funds drawn on a U.S. bank only) to the following
address:

Hermann Edelstein
4 Albert Drive
Monsey, N.Y. 10952

This registration fee also entitles you to the following:

a) BSED - A program that converts DBASE (tm) code for generating screens
to QUICKBASIC code.
b) BOX - A couple of QUICKBASIC subroutines that let you draw boxes on the
screen while in text mode.
c) You may get future releases of SCREEN at a nominal fee.


 December 17, 2017  Add comments

Leave a Reply