CAPÍTULO II MARCO CONCEPTUAL DE REFERENCIA
1.1. El profesor como un profesional de la enseñanza
tions by placing an asterisk in front of the field tag name. Should you change your mind about a field that has been selected for outpUt9 cancel the last selection by using the BACK WINDOW comand key. When all desired fields have been chosem press the <RETURN> key to
move on to the next section. QUERY
will
askif
totals are wanted onthe numeric fields.
DO YOU WANT TOTALS PRINTED AT THE END OF THE QUERY? <N> The next prompt
will
be:ENTER ITEM TO SELECT BY OR PRESS <RETURN> TO CONTINUE:
MAKING SELECTIONS IN QJJERY
These are the logical operators available in QUERY (less than, less than or equal to, etc.)c that are used to define a subset of data from a
file.
<: LESS THAN {: LESS THAN OR EQUAL TO >: GREATER THAN }; GREATER THAN OR EQUAL TO
if
the field selected is numeric youwill
see: NUMBER:=: EQUAL TO X: NOT EQUAL TO
if
the field selected is alphanumeric you will see: STRING:S: STRING COMPARE @: STRING INCLUDES As you respond to the prompt line
it
will
change by translating your responses into the appropriate words. QIJERYwill
also mark the field nameslist
on the upper portion of the screen with the selectedsymbol.
If
a greater than and a less than are specified for the samefielch a range of records between the two values will be selected. The maximum number of selection criteria allowed fs 10.
QÍOOSING AN OUTPUT SEQJJENCE FOR QJJERY
QUERY will display the available indexes for the
file.
Select theindex that you want to determine the sequence or order of the QUERY
output.
If
you press <RETURN> and do not enter an index number, theoutput will be ordered according to the record number of the data.
————— ———————.,————-————————-—
DataF1ex 2.0 User's Manual QUERYING THE DATABASE A-45 —— ——————————
*
l
---> <VENDOR ID> 2 ---> <VEND0R NAME>OUTPUT OF THIS QUERY SHOULD BE LISTED BY:
QUERY will then ask for the TITLE OF THE REPORT. This information
wiR appear at the top of each page of a report format QUERY. ENTER THE REPORT HEADER:
Next, QUERY wi71 prompt for the output destination. At this point you
also have the option of using QUERY to create a configuration
file
fora DataFlex report. The default for this prompt is to output a report formatted query to the screen.
AT THIS POINT YOU MAY SELECT WHERE THE OUTPUT OF THIS QUERY SHOULD BE DIRECTED. YOU MAY ALSO SELECT THE FORMAT FOR A REPORT IMAGE FILE.
OUTPUT QUERY TO:
(S)creen, (P)rinter, (F)i1ey (R)eport imagep or (A)bort: An entry of "S" will cause the output to go to the CRT screen; "P"
will
send the output to the printer; "F"will
directit
to a disk fi7e (you will be prompted for affle
name); or "R" will create a "ReportImage" (see next paragraph). A <RETURN>, or default, response
will
be executed as though "S" were selected. Both the "F"(file)
and "R"(report configuration) options will trigger the questions below.
USING QUERY TO GENERATE A REPORT CONFIGURATION
By making an "R" response to the output option prompt you will start
the creation of a report configuration
file.
The next promptwill
ask which of three formats, Report, Reach or Quoted, you want used for the data output when the report is run:SELECT THE OUTPUT FORMAT TO BE USED
1)Report, 2)Reád» or 3)Quoted format:
I) REPORT FORMAT: A formatted columnar report consisting of a
title
sectiom column headerm data elements arranged in columns under their
appropriate names, and totals
(if
selected) at the end.2) READ FORMAT: A sequential ASCII format consisting of each data element on a separate line terminated with a carriage return. This is the format that the DataFlex
utility
READ uses to "Read" data into a DataFlex data basefile.
__—————__——______=————
A-46 QUERYING THE DATABASE DataF1ex 2.0 User's Manual —————————————— ===——
3) QUOTED FORMAT: A sequential ASCII
file
format compatible with manyversions of BASIC and the "merge"
files
created and used by many wordprocessors, in which quotes and commas ("BJ') are used to delimit
fields and each record is terminated by a carriage return. Leading and
trailing
blanks are trimmed from the fields of output from QUERY,but not from output of the generated report configuration (unless you
subsequently edit
it
to do SO). Then youwill
be prompted:ENTER THE REPORT IMAGE NAME (8 MARACTERS MAX)?
Respond with the fi7ename up to eight (8) characters in length that
you wish the report source configuration
file
to be stored under bythe operating system. QUERY will add an extension of .RPT to your
entry resulting in a final name of the
file
of fi1ename.RPT.Thereforep you must not specify your own extension to the filename.
If
you doF QUERY will ignoreit.
If
afile
already exists with that name (filename.RPT), QUERYwill
issue a warning message to that effect and ask whether or not to
overwrite the
file.
The default response in this case is <N>. Next you will see a message:REPORT IMAGE CREATED!
PRESS <RETURN> TO CONTINUE...
QLJERYwill then again display the output option prompt shown above. which is intended to give you the opportunity to output the actual
data (as opposed to the report configuration
file
which you have justcreated).
If
your only purpose for running QUERY at this point was tocreate the REPORT configuration fí1eg choice "A" to abort would be
your choice.,
In order to use the report configuration
file
created by QUERY9 you must compileit
into a .FLXfile
with the comnand: A>COMP fl1ename.RPTwhere filename is the name you gave the
file
in answer to QUERYG prompt above. Prior to compiling itg you may wish to modifyit
in one way or anothem in which case you may do so as you would with anyother DataFlex configuration source
file
(see the chapter on How toWrite a Configuration in this manual). The compiled configuration would then be executed from the operating system with the comand:
A>FLEX filename {output destination}
—————
—— ————————-—————— —— B"l ——————————————————
·
========== ==========
EEEEE===== PROGRAMMING TUTORIAL
zm:
zz="======="=== _______"_"
CREATING A DATAFLEX APPLICATION OF YOUR OWN
In this section of the tutorial, you will experience how easy
it
is tocreate an application using DataF1ex without ever having to "program". Them once you have an application functionfngg you will be introduced
to what can be done by putting just the slightest effort into
"customizing" your application requirements.
To achieve this, we have decided to appoint you as manager in a company that has just bought their
first
microcomputer with word pro-cessing and DataFlex. As the member of the group who "took a computer course in co1lege'% you have been selected to be the one to become
familiar with the new system and to undertake the development (and
perfection!) of some new management information systems.
Being a creative and thoughtful gi"wpó you and your associates recog-
nize the value of properly planning the information system. The
first
task defined is to develop a personnel information system for the company.
DataFlex provides several methods to implement your application
requirements. The easiest and most efficient at this point is the
facility
for you to create an "image" of a data basefile
on your CRT screen using a word processor or the DataFíex Editor program.An "image% in DataFlex termino1ogyg is a format into which data can be inserted for output.
It
can be displayed on a CRT screen, or on aprinted report. The image can include prompting or 1abelling for
information which is stored in the data base, and "windows" where the
stored data will be output. DataF1ex images are created with a text editor (one is included with DataFlex) or any word processor that can
create and edit a plain ASCII
file.
Creating an image with youreditor allows you to develop a visual approach to designing your
applications that combines how
it
looks with howit
works. When an "image" is comp1eté»it
may be processed by autility
programsupplied with DataFlex, called AUTODEF, into a data base
file
definition and data entry screen. AUTODEF reads in the "image"
file,
asks you some questions about how you want things to workg and thenoutputs another
file
(called a "configuration source"file)
onto yourdisk that can be compiled and executed as is, or modified to meet a
particular set of requirements, and then compiled. The rest of this
section illustrates this process. There are othéi"» more flexible ways
of accomplishing these functions (such as through FILEDEF) which are
described elsewhere in this manual.
—-——
B-2 PROGRAMMING TUTORIAL DataF1ex 2.0 User's Manual
—'—
'————
Getting Started...
To speed the familiarization procesSg we have made up an image