7 |
The LA Fox Developer Newsletter
March 1998
VFP Tip of the Month...
New DEBUGOUT Command
by Rick Schummer
Try to picture this scenario.., you are sitting at your PC for some
16 hours cranking out code that is far cooler than any code you
have created before. suddenly you hit a wall, the blinding bug
that cannot be figured out by sight alone. What is the first thing
many of the FoxPro developers do to figure out what is going
wrong? A fresh can of Coke and WAIT WINDOWS to the
rescue! How many of us have resorted to displaying WAIT
WINDOWS with values or hit the old FoxPro 2.x and VFP 3.x
Debug windows and started evaluating variable values and
different conditions? Well there is a new tool in town and it is
called DEBUGOUT.
that is directed to the file also includes ASSERT messages and
events that are specified with the Event Tracking dialog box (or
with SET EVENTLIST).
The last thing about this command i want to discuss is the
abbreviation. Since FoxPro already has the DEBUG command
to make the debugger active, the abbreviated command is six
characters long, DEBUGO. Sounds funny to me and maybe
you see this as a way to add some humor to those hopefully
short debugging moments.
[Ed. Note: Rick Schummer is the President of The Detroit Area
FoxPro Users Group and can usually be found building FoxPro
developer tools, and is always looking for ways to make his job
fun and increase his productivity with tips and tricks. You can
reach him at 74503.2245@CompuServe.com.]
Now at first I thought that the Microsoft team employed a little
artificial intelligence and figured out a way to know what my
bugs were and just get the De Bugs Out. But sadly it is not
this easy. By now much of the VFP 5.0 development commu-
nity is aware of the new and improved Debugger, well at least
those developers that have created bugs in their code. There is
a window in the new debugger that is called “Debug Output”.
The new DEBUGOUT command will display an evaluated
expression in this new window. For examole, the following code
in a CommandButton Click() methOd:
S
DEBUGOUT “Made it to the”
+
PROGRAM()
+
“0
code”
DEBUGOUT THISFORM.txtCompany.Value
DEBUGOUT SET(”DELETED”)
DEBUGOUT THIS.Visible
Results
in:
This is far more powerful than a WAIT WiNDOW for the simple
fact that you do not have to convert the output to character
type’
On the other hand the DEBUGOUT command does not have a
WAIT pause built in which can be solved with using breakpoints
when needed. The DEBUGOUT feature is designed to see
evaluations within loops, or concentrate on the flow of the
process.
Other advantages include the ability to divert the results to a file
via the SET DEBUGOUT TO [FileName [ADDITIVE]] command.
Along with the DEBUGOUT evaluations, the debugging output
Special Big Announcement
The LA Fox Developer’s Group has entered into an agree-
ment with Macmillan Computer Publishing. LA Fox mem-
bers can now purchase all Macmillan Computer Publishing
titles at a discount of 30% off retail pricing.
Mrncmi’lan owns the following publishers:
•
Que
New Riders Press
The Waite Group
•
Ziff-Davis
•
Sams/sams.net
•
Que Education & Training
•
Macmillan Technical Publishing
•
Hayden
Adobe Press
•
‘Borland Press
Lycos Press
With all these publishers and over 40% market share,
Macmillan has the best books for computer technology.
To take advantage of this offer, you must be a member-in-good-
standing (read current and paid-up) and have a credit card. You
can receive our special account number and the 800 access
number by calling me at 800/499-6237 or 714/375-3300, ore-
mailing me at CompuServe (72723,3422) or brlee@earthlink.net.
Join
LA Fox
|
7 |