
This article is reprinted from the February 1991 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.

Q&A

File Under BUILD

Q:              I am attempting to use BUILD to create RunTime applications.  I am
having difficulty determining how to copy certain .PR2 printer driver files
along with my application.  How is this done?

A:              BUILD does not copy printer driver files.  This file type is not
included under the Options: Include file types submenu.  It is assumed that
in distributing applications, the destination hardware setups would likely
vary to such a degree as to make program references to particular printer
drivers impractical.  
It is anticipated that either the developer will set up the printer
configuration or the developer's installation routine/batch file will allow
for printer definition.  In either case, this will be done at install time
by extracting the needed driver or drivers from the DRIVERS.EXE file.

"I Know You're In There"

Q:              I have a command line in a program I use that searches memos for
certain character strings.  I use the expression:

LOCATE FOR stringexp $ memofld

However, in some cases, it doesn't seem to work.  The program will return a
"Not found" condition, yet I can go into the memo and see that the string
is there.   Why does this chronically occur?

A:              If your memos are more than 254 characters, this method would work
fine.  However, the $ operator, originally designed to search only
character fields, is limited when it comes to a more substantial memo
field.  Try using this expression instead:

LOCATE FOR AT(stringexp,memofld) <> 0


No Need to Rub It In

Q:              I'm using a format file to handle my data entry but, in one case, I
am annoyed with a message that pops up in a field to which I've assigned an
"Accept value when" condition.  The message is "Editing condition not
satisfied (Press SPACE)".  Is there anyway to eliminate this.  I don't want
another message of my own but neither do I want this one.  Call me picky
but I'd really like to know if there's a workaround.

A:              By entering two quotes ("") in the Edit options: Unaccepted message
expression area, you can eliminate all but the Press SPACE portion of that
message.  If that is still unsatisfactory, you can use ON READERROR in your
program or setup that can either sound the bell, initiate a UDF or simply
do nothing.

To sound the bell after an invalid entry,

ON READERROR ?? CHR97)

To activate a UDF:

ON READERROR ?? UDFname()

To do nothing after an invalid entry,

ON READERROR ?? ""

Today At the Touch of a Button

Q:              How do I program a function key to automatically enter the current
system date into a field?

A:              That depends on where you are when you press the function key.  In
an @..GET scenario, where you've actually programmed the input of
information into a variable or field, you can use

SET FUNCTION Fn TO SUBSTR(DTOC(DATE()), 1, 2) + SUBSTR(DTOC(DATE()), 4, 2)
+ SUBSTR(DTOC(DATE()), 7, 2)

where n is a number 1 to 10.

However, in a full screen command such as EDIT or BROWSE, the function keys
are disabled from full user-programmed control.  If this is where you plan
to use your function key, include the following in your setup program:

ON KEY LABEL F7 KEYBOARD SUBSTR(DTOC(DATE()), 1, 2) + SUBSTR(DTOC(DATE()),
4, 2) + SUBSTR(DTOC(DATE()), 7, 2)


Little Sir ECHO

Q:              The Label generator is giving me problems in my 1.1 version of
dBASE IV.  After going through all the motions of creating a label, then
typing 

LABEL FORM <Filename> TO PRINT

all I get is a screen full of commands and instructions.  It is as if I had
TYPEd the code (.LBG) file.  

A:              Somehow a dBASE switch that is normally OFF has been set ON.  This
switch, called ECHO, is responsible for the printed instructions you see. 
It's useful for when programmers need to debug their program listings while
the program is running.  It isn't 
very useful for printing labels.

At the dot prompt, type 

SET ECHO OFF

prior to your LABEL FORM command.  To make this change permanent, enter a
line in your CONFIG.DB file that says

ECHO = OFF

To access the CONFIG.DB, enter MODIFY COMMAND CONFIG.DB at the dot prompt. 
After making the change, enter Ctrl-End to save.


PostScript Modification

Q:              I am using your PostScript driver and all was originally okay.  Per
the instructions in Getting Started, page 2-11, I made a small modification
to adjust how the text was centered.  Afterwhich, I could not make anything
print at all with the PostScript driver.  What am I doing wrong?

A:              You may not have done anything.  Depending upon how you made the
change, we have found that some text editors leave an EOF (end of file)
marker at the end of the .DLD file.  This keeps any output following the
POSTSCRI.DLD file from printing.  A way to remove the EOF marker after
mofidying the .DLD file is to do the following trick in DOS:

TYPE POSTSCRI.DLD>TEMP
TYPE TEMP>POSTSCRI.DLD

This little turnabout will eliminate the unwanted marker and allow the
driver to work properly again.


Wide Open Spaces For RunTime

Q:              As I attempted to install RunTime on my hard disk, I noticed that I
received "File not found" errors after inserting Disks #2 and #3.  However,
the installation continued and finished, apparently successfully.  But
RunTime didn't work.  All the files appeared to be there.  Do I have bad
disks?

A:              Probably not.  This situation will typically occur when attempting
to install RunTime without enough free hard disk space.  RunTime needs at
least 2.5 MB to install.  If you'll notice on your present installation,
the RunTime.OVL file (a whopper of a file under normal circumstances) is
unusually small.

The No Match Game

Q:              I'm designing a query and I'd like to be able to find all records
in a parent file that do not have a match in the related child file.  I
cannot quite figure out the proper way of accomplishing this.

A:              There is a way.  First, we'll name our cast.  The parent file we'll
call MASTER and the child file we'll call TRANS.  The linking field will be
refered to as CODE.  
In the CODE field of the MASTER file, enter

EVERY LINK1

In the child file, TRANS, also under the CODE field, enter

LINK1

Here's the trick to make it work.  Add a condition box, and place within it
the expression:

MASTER->CODE <> TRANS->CODE

This will result in a list of records from MASTER which have no match in
TRANS.   

