
This article is reprinted from the December 1990 edition of TechNotes/dBASE
IV.  Due to the limitations of this media, certain graphic elements such as
screen shots, illustrations and some tables have been omitted.  Where
possible, reference to such items has been deleted.  As a result,
continuity may be compromised.  

TechNotes is a monthly publication from the Ashton-Tate Software Support
Center.  For subscription information, call 800-545-9364.

Etc.

Reporting to the Screen

Have you ever wanted to take the report you just perfected and use it not
only to create printed output but display the information on the screen as
well?  As you probably already know, if you display the report to the
screen, it goes scrolling by as a continuous stream of text.  The report
design screen gives you this ability through the Print: View report on
screen option but, unfortunately, there is no clean, easy way to access
this option from a program without modifying the .frg file.  But if you had
a UDF strategically placed in the design of the report, the need to perform
a manual modification of the .frg would be gone.

Stop() is designed to be used in the page footer band of a report.  It is
implemented in such a way that it may be inserted into a report that will
be sent to the screen or printer without causing a problem.  It can be
turned on or off by the use of a logical variable switcher.  When this
variable is set to .T., the Stop() function causes the report to pause for
each page, prompting the user to either press C for continuous, Escape to
abort or P to momentarily pause between each page and then continue. 
Stop() is status sensitive.  In other words, it will see the status bar if
it is on and display the report information above it.

There are, however, a few things you need to know before you use this
function.  Stop() requires version 1.1 of dBASE IV.  The variable s_or_p
must be initialized to .T.  prior to using Stop() during design or at
report time.  Stop() also requires that you have at least one line in the
footer band and that band is open, even if Stop() is the only item in the
band.  That line is used to display the prompt message mentioned
previously.   The system memory variable _plength should be set to 22 with
the status bar on or 25 with the status bar off.  In addition, _pform
should also be set to "NONE".

The calculated field in which you place Stop() cannot be named and
therefore, cannot be hidden.  However, the field can be any size and placed
anywhere in the band as long as nothing else is on the same line and it is
the last item in the Page footer band.  The expression for the calculated
field should appear as:

                IIF(s_or_p, Stop(),"")

This allows the function to be turned off via the s_or_p logical variable
and ensures that the function will not add anything unwanted to the
report.  It is a good idea to clear your keyboard buffer and screen after
the report is finished. 

Function: Stop()
FUNCTION STOP
    @ IIF(SET("STATUS") = "ON", 21, 24),0 SAY 
      "Press 'C' for continuous 'P' to pause 'ESC' to exit or any" +;
        " other key to continue"
    SET CURSOR OFF
    temp = INKEY(0)
    SET CURSOR ON
    DO CASE
      CASE temp = 27          && The Escape key
        gl_Prntflg = .F.
      CASE temp = 99 .OR. temp = 67   && the letters c or C
        s_or_p = .F.
      CASE temp = 80 .OR. temp = 112  && the letters p or P
        temp = INKEY(1)
        KEYBOARD chr(80)
    ENDCASE
RETURN ""   

RunTime and Cache

If you are using BUILD with the dBASE IV cache, you will discover that
BUILD copies the following files to the designated drive or directory:

                RunTime.exe
                RunTime.ovl
                RunTime.res
                RProtect.ovl

Attempting to run the application will result in the computer hanging or
returning to the DOS prompt.  It is the absence of the file RunTime1.exe
that causes this problem.  Copying it to the proper drive or directory will
get you up and running.  But the problem itself implies something deeper.

Since the file RInstall.bat handles the copying and creating of the RunTime
files (including distributing the large RunTime.ovl file over several more
than one disk and reassembling it on the target hard drive), this could
very well be the method of choice for creating distribution disks.

Developers should not anticipate the caching needs of their users and
CacheRT.bat is provided and installed via RInstall.bat.  This way, users
can customize their applications to their individual machines.

"It's Not What You Said, It's How You Said It."

When you create a query to specifically select records without blank date
fields, you may find yourself trying a number of different methods.  You
may, at first, try placing expressions like # {} or > {  /  /  }  under the
DUE_DATE field marker in the file skeleton. You'll find that doesn't work. 
So your next step is to open a condition box and put in an appropriate
expression like one of the two below:

                DUE_DATE <> {}
                DUE_DATE # {  /  /  }

This only brought you more desperation since it also didn't result in a
query that listed only those records with valid dates.
The expression that ends up working isn't one that might've been your first
choice:
                .NOT. DUE_DATE = {}

So why, one might ask, is this expression the one that gets the results,
even though the other is accepted by QBE?  The .NOT. operator is evaluated
outside the rest of the expression as if it were outside of parentheses.   


