In this instance, the brackets {} are to be actually typed in the
configuratiom contrary to the notation elsewhere in this manual where
brackets are used only to signify optional cormand e1«nents to the
reader of the manual.
Format options for the ENTRY command are as follows:
F|INcTTnN SJLNIU
DECIMAL POINTS {P0INTS=n} where "n" is the number of places to the
right of the decimal point in the window. This can
reformat a window or can be used to configure an
integer-only numeric field by setting a value of zero (O) for "n".
————————— — ————
C-20 DATA ENTRY DataFlex 2.0 User's Manual
~——— = ~——~——————
AUTOFIND* {AUTOFINCñ Executes a FIND EQuals on the main index of which the data elment on the EN7RY command line is a
part.
If
the desired FIND is on a multi-segment index, the AUTOFIND should be on the last entrycommand for the segments that make up the index, so
that all data necessary for FINDing has been entered
prior to execution of the AUTOFIND. Record number may
not be part of the index of which the AUTOFINDing data element is a part. Windows for data from related
files
will also be fi11e& provided there are ENTRY connands for those windows.SKIP IF FOUND* {SKIPFOUNCñ Display data in the window
if
a record isFOUND with key data matching the data in the wiñájwY and move the cursor to the next window.
If
no suchrecord has been F0UNlj, leave cursor in window and accept operator input.
FIND REQUIRED* {FINDRECÜ Requires that an active record be in the
buffer before the operator can pass this window in the image. The
cursor will rémaln in this window until a
successful FIND Is completed. The BACKFIELD Flex-key can move the cursor in reverse to execute the FIND on
another window. Pressing the CLEAR Flex-key will
return the cursor to the
first
wfndow on the image. UPPER CASE {CAPSLOCK) Converts all lower case alpha charactersentered in the window to upper case.
REQUIRE ENTRY {RE(JLJJIRED} The cursor cannnot be moved to the next data entry window until data has been entered into the
current window.
RANGE CHECK {RANGE = #L iC2} {RANGE.= nn/ddlyy. m/dd/yy} Provides an automatic check of entered data and declares an
error and returns the cursor to the window
if
the date or numeric value entered does notfall
within the specifications in the comand. Thefirst
value is the low end of the rangep and the second is the high end. The upper and lower values in the comand are included within the valid range. Literal numbers and dates can be used. Variables may not be used.VALIDITY MECK {mECK="entryl|entry2|entryn"}{MECK=string_var}
Provides an automatic check of entered data and
declares an error and returns the cursor to the window
if
the entry does not match any substring in the aiux comand. Where an eligible entry has fewer charactersthan the window9 the excess characters must be speci-
fied as spaces (shown below as 16). The vertical bars
(I) shown below are recomended optional delimiters.
De1imitersp
if
úSéd,r should be characters unlikely to be input erroneously by operators. The connand mayalternatively reference a previously-defined in-memory
string variable (not a window or database element): {MEa(="YEslNoBlYBBlNBB"}
"————————————————————
"
DataFlex 2.0 User's Manual DATA ENTRY C-21
FORCE PUT {FORCEPUT} Puts data in the windows to the record
buffer regardless of whether any data has been changed from that originally displayed. Norma11yg a put will
not occur unless some data has been changed. DO NOT PUT DATA {NOPUT} Do not put data from the window into the
record buffer. This protects data from being changed by the operator.
NO DATA ENTRY {NOENTER} Data from the found record is displayech but
the cursor skips the wiñdowo preventing entry. NOENTER skips the window even
if
no record is found, unlike SKIPFOUND (see above).DISPLAY ONLY {DISPLAY0NLY} Combination of NOFUT and NOENTER above. Data is not moved from the window into the record
buffer, and the cursor skips the window.
RETAIN DISPLAY {RETAIN} Maintain the data in window even
if
a CLEAR command is execute6 but clear the windowif
twosuccessive CLEARs are keyed.
RETAIN ALWAYS {RETAINALL} Maintain data in window at all times; never clear.
* The cotmands with asterisks are all FINDing comandm and may be used only on windows relating to indexed database elements (see the
chapter on "Designing Databases" for more information on indexing).
The command options, and the formatting options above can all be used
cumulatively on an ENTRY command line:
EN1RY
file.field
page.5 {AUTOFIND,SKIPFOUND,CAPSL0CK}The maximum length of any DataFlex comnand line is 255 characters.
Multiple options on an ENTRY command line are all enclosed within the brace characters {braces}, separated by comas (,)¿
A special form of the ENTRY command is used where expressions are to
be displayed. The default mode of the window becomes display only when this format is used.
FORMAT:
ENTRY (expression) w1ndow_arg EXAMPLE:
ENTRY (date_today+30) screen.5 ENTRY AND AUTOPAGE
The ENTRY command can be used without specific reference to image windows by using the-AUTOPAGE command. (AUTOPAGE functions automati-
cally in the ENTER macro for the
first
screen imagep and needs to beexplicitly written only
if
there are two or more screens.) AUTOPAGE ———————————— ——————— ____=~_=~~~~>=————C-22 DATA ENTRY DataF1ex 2.0 User°s Manual
sequentially
(left
to right9 starting witht the top line and working down) accesses the windows of the screen image named as the argumentof the command (see the section of this manual on Direct Control of
Data Entry), and permits the window references to be
left
off. NOTE: The ENTRY command can ONLY by used within the ENTRY section ofthe ENTER macro or within the ENTERGROUP command.
Since ENTER is internally composed of a set of subroutines, a RETURN command is required to terminate the ENTRY section of the configura-
tion.
If
you don't need any of the user-defined procedures or post-entryprocessing, you may simply end the ENTER configuration with an ENTEREND.
The next page illustrates a totally straightforward, unimaginativeg yet efficient ENTER configuratiom
It
makes use of the AUTOPAGEfunction, so page window references are not necessary.
It
has all ofthe components of an ENTER configuration: 1. A labeled image
2. An OPEN command with filename argument
3. An ENTER command with filename argument
4. ENTRY commands with data element arguments
5. ENTRY commands terminated by a RETURN
6. An ENTEREND command to end the configuration
~
DataFlex 2.0 User's Manual DATA ENTRY C-23 ="=———___—~—
——————— EXAMPLE FORMAT FOR ENTER
/LIST My Mailin' List Name: Address: City: State:
_
ZIP:l*
// --
pre-enter--
OPEN MAIL
//
open datafile
ENTER MAIL '//
start enter macro// --
begfning of entry section--
AUTOPAGE LIST
//
sequentially assign windows//
not actually required in this//
single-screen configurationENTRY MAIL.NAME {AUTOFIND} ENTRY MAIL.ADDRESS
EN1RY MAIL.CITY
EN1RY MAIL.STATE {CAPSLOCK} ENTRY MAIL.ZIP
RETURN
//
end of entry section//
not actually required since next//
command is enterend ENTEREND//
end of enter macro———————
C-24 DATA ENTRY DataFlex 2.0 User's Manual ——————
THE USER-DEFINED PROCEDURES
Many ENTER configurations
will
need to perform updates in relatedfiles,
have error checking or delete protection built im etc. Theseoperations are accommodated by five user-defined procedures which are
automatically executed when the corresponding DataFlex Flex-key is pressed during the execution of the ENTER configuration. The User-
Defined procedures are:
ENTER.SAVE: executed on a SAVE command ENTER.DELETE: executed on a DELETE command
ENTER.EDIT: executed on an EDIT and on a DELETE command ENTER.CLEAR: executed on a CLEAR command
ENTER.EXIT: executed on an EXIT command
These ljser-Oefined procedures are automatically called by the ENTER command macrog but they are functiona11y no different from any other labeled DataFlex sub-routine called by your own GOSUB comands. The
inclusion of the colon ":
"
at the end of the procedure name isrequired to identify them as labels; om!tting the colon will cause an
error.
If
an ERROR is declared within any of the procedures the associatedfunction
will
be disabled.The ENTER.SAVE procedure is executed whenever a new record is created or an existing reccmi is edited.
The ENTER.DELETE procedure is executed whenever an existing record is deleted.
The ENTER.EDIT procedure is executed whenever an existing record is deleted OR an existing record is edited. This works well with the save procedure to keep the consistency of counters and totals in a
related
file.
The ENTER.CLEAR procedure is executed whenever the CLEAR Flex-key is
pressed.
The ENTER.EXIT procedure is executed whenever the escape key is
hit
and is primarily intended to allow conditional disabling of the escape key by declaration of an error.Each of the User-Defined procedures must be ind1vidua1ly terminated
with the use of a RETURN command (see the example on the next page).
DataFlex 2.0 User's Manual DATA ENTRY C-25
The configuration below illustrates the use of the ENTER.SAVE and ENTER.EDIT procedurem which are executed every time a record is saved and edited/deleteck respectively. An application requirement for a
mailing
list
uses only onefile
for thelist
information. However,it
is desired to maintain an on-line counter of how many records are in
the
file.
To do this wewill
establish a field in the systemfile
(SYSFILE.COUNTER) that contains the number of records in thisfile.
To maintain the count correct1y? the counter must be incremented when a record is created; when a record is dejete6 the counter must be decrementéd» and when an edit is donep the counter must beleft
unchanged. /LIST My Mai1in' List Name: Address: City: ST:_
ZIP:l*
//
only those parts of this example that are changed have comments OPEN MAILOPEN SYSFILE
//
open otherfile.
ENTER MAIL AUTOPAGE LIST
ENTRY MAIL.NAME {AUTOFIND) ENTRY MAIL.ADDRESS
ENTRY MAIL.CITY
ENTRY MAIL.ST {CAPSLOCXJ ENTRY MAIL.ZIP
RETURN
//
The ENTER.SAVE procedure will execute whenever a record is saved.//
When a record is createcb only this procedure is executed,//
incrementing the counter.ENTER.SAVE: CALC (SYSFILE.COUNTER+1) TO SYSFILE.COUNTER SAVE SYSFILE
RETURN
//
return from save procedure//
The ENTER.EDIT procedure is executed whenever a record is deleted//
or edited. For a delet1omit
decrements the counter.It
also//
decrements the counter in an edit, but true edits are followed by//
SAVEm which execute ENTER.SAVE, offsetting the decrement to zero. ENTER.EDIT: CALC (SYSFILE.COUNTER-I) TO SYSFILE.COUNTERSAVE SYSFILE
RETURN
//
return from delete procedure ENTERENDC-26 DATA ENTRY DataFlex 2.0 User's Manual
ENTDISPLAY Command
The ENTDISPLAY comand causes all ENTRY data elments for the data
file
named in the argument to display on the screen, along with allthose in other related
files.
Its apparent effect is exactly as though the SUPERFINO Flex-key had been pressed by the operator.It
may be used in the ENTRY section of an ENTER or ENTERGROUP configura-tion and/or in a KEYPROC (for the FIND key, for example). FORMAT:
ENTDISPLAY <df_ff1ename>
Where <df ff1ename> is the name of the data
file
from in whichthe displayed record is to be found. EXAMPLE:
FIND GE mail BY INDEX.I ENTDISPLAY mail
ENTDISPLAY would be used, for examp1eg in an alphabetic FIND such as
the one in the configuration above which is done with the AUTOFIND
option on the ENTRY MAIL.NAME line.
If it
is desired, however, to do a FIND greater than or equal to (frequently desirable when the FINDtarget's spelling is not exactly known), the AUTOFIND option wIll not
allow this9 since
it
only does exact FIND equals. For that, thefollowing configuration would be appropriate (note the differences):
/LIST My Mai1in' List Name: Address: City: ST: ZIP:
l*
//
only those parts of this example that are changed have connents//
this configuration will always find a record OPEN MAILENTER MAIL AUTOPAGE LIST
ENTRY MAIL.NAME
//
AUTOFIND removed hereFIND GE MAIL.NAME
//
FIND greater than or equal to added here ENTDISPLAY MAIL//
ENTDISPLAY comandENTRY MAIL.ADDRESS ENTRY MAIL.CITY
ENTRY MAIL.ST {CAPSLOCK} ENTRY MAIL.ZIP
RETURN ENTEREND
Another use of ENTDISPLAY im in a multiuser environment9 after a REREAD command, to display the REREAD record for inspection.
DataFlex 2.0 User's Manual DATA ENTRY C-27 =========——————————————————————
POST-ENTRY PROCESSING:
After the end of the User-Defined procedures, the comand ENTEREND must be used to terminate the ENTER macro. When the escape key is
pressed, the ENTEREND command
will
close out the ENTER macro. At this point you may ABORT configuration, (MAIN to another configuration, or proceed with any other sequence of DataFlex commands.ENTER — SEQUENCE OF OPERATION:
An understanding of the order in which the ENTER macro executes
specific functions will aid in the development of more complex
configurations. Steps that involve specific multiuser operations are
Identified. DataFlex systems in which single-user mode was selected
(see SETSCREEn procedures) will not perform these multi-user
functions.
CREATING A NEW RECORD:
a) Clear screen and clear record buffers. b) Operator
fills
in the data windows.c) Operator hits the SAVE key or exits the last image window. d) Record is autcxnatica11y locked and related records are re-
read from the database (multi-user systans only). e) Data in data windows is moved to record buffer(s)
accwding tQ the ENTRY cQnnands.
f) ENTER.SAVE procedure is executed (including any parts defined by the user).
g) Records are ATTANed and SAVEd to disk.
h) All records are unlocked (multi-user systems only).
i) Screen and record buffers are cleared for new entry.
EDITING AN EXISTING RECORD:
a) Clear screen and clear record buffers.
b) Operator FINDS a record in the main
file
by any availablekey.
C) Related record(sb
if
any, are found and displayed. d) Operator changes data in window(s).e) Operator SAVES record.
f) Records are locked and ali active records are re-read from disk (multi-user systans only).
g) ENTER.EDIT procedure is executed (including any parts defined by the user).
h) Data is moved from CHANGED data windows to record buffer.
i) ENTER.SAVE procedure is executed (including any parts defined by the user).
j)
Records are ATTAMed and SAVEd to the data base. k) All records are unlocked (multi-user systans only).I) Screen and record buffers are CLEARed for new entry.
C-28 DATA ENTRY DataFlex 2.0 User's Manual
DELETING A RECORD:
a) Clear screen and clear record buffers.
b) Operator FINDS a record in the main
file
by any key.c) Related record(sL
if
any, are found and displayed. d) Operator presses the DELete RECord key.e) Records are locked and all RELATED records are re-read from
the data base (multi-user systems only).
f) ENTER.DELETE procedure is executed (including any parts defined by the user).
g) ENTER.EDIT procedure is executed (including any parts defined by the user).
h) Record in main
file
is deleted.i) Related records are saved.
j)
All records are unlocked (multi-user systans only).k) Screen and record buffers are cleared for new entry. ENT$PERMISSIVE INDICATOR
The ENTER macro is designed to prevent errors of the sort which could
arise from operator sequences such as the following:
a. Operator finds a record and one or more related records by use of SUPERFINO (the display of data from records in multiple
files
related to each other is not necessarily apparent to theoperator);
b. Places cursor in a key field in a related-to record; c. Presses FIND and FINDS another record in the related-to
file,
bringingit
into the record buffer with the earlier-found relating record; and
d. SAVES this combination of possibly-unrelated records as though they were related to each other.
What actually happens in this instance is that the ENTER.EDIT
procedure is executed on the NEW record Instead of the OLD one. This
makes the totals and counters in both the old and new related-to
files
incorrect.This possibility is eliminated by the internal resetting of the FIND key to function as a SUPERFINO (i.é.v
it
will find only combinationsof records actually related to each other) after a SUPERFINO has been donep just as the NEXT RECord and PREVious RECord keys do. Similarly,
after a SUPERFINO, the AUTOFIND option is switched off on all but the main fi1ep so that those fields may be edited without interference from undesired AUTOFIND'lng.
If
the option of editing the AUTOFINDingfields is not desired9 editing can be prevented by addition of the NOFUT option to such fields.
The ENT$P£RMISSIVE indicator will allow operational sequences like the one described above, which is normally an errom by not resetting the
functioning of the FIND key and the AUTOFIND option. For those
situations in which
it
Is a permissible sequenceg the statementDataFlex 2.0 User's Manual DATA ENTRY C-29
—
"INDICATE ENTSPERMISSIVE TRUE" should be given prior to the beginning
of the ENTER or ENTERGROUP macro. This option should not be used in
transaction-oriented applications in which counters are provided and/or transaction totals are maintained.
C-30 DATA ENTRY DataFlex 2.0 User's Manual ————————————————— ————————————————————————
THIS PAGE INTENTIONALLY LEFT BLANK
—
_ _ _ _ _ _ _ _ _ _ _ _~, ————————~——————~___————___========== C~31
_ _ _ _ = ~=~~~~——~~~~µ"~ —~~~————~
—
====
REPORTING AND OUTPUT ==========""—~~
————————————
——————
—————— ~==========~~———————~———————~—————~— —Two areas of activity consume a great portion of the development time
for application software: (a) data entry and
file
maintenance; and (b)file
output for reports. 1abe1sp preprinted forms andfiles.
The DataFlex ENTER command macro provides a predefinedfacility
fordealing with the requirements in the
first
area efficiently; theREPORT command macro takes care of the second.
The REPORT command macro consists of an integrated set of selectable predefined output routines that can be chosen as needed. You can use