^1                                  BITS 'N PC's
                               By Joel Ellis Rea


A collection of Hints, Tips and Bug Reports for all programmers and interme-
diate to advanced users.  

BUG REPORT -- Microsoft QuickBASIC Version 2.0:  This is an excellent pro- 
gramming language.  We use it ourselves to compile BASIC and BASICA programs 
that users submit to us, so that they can run on all machines with minimum 
problems.  It includes an integral mouse/keyboard full-screen editor with pop-
up menus, much like you'd expect in Microsoft Windows or the Macintosh.  

The bug is in the DEBUG compiler option.  This option, when set, allows the 
system to locate the point of a run-time error and map it to the source code so 
you can see where it is.  It also adds checking between statements for a CTRL/ 
BREAK keypress to stop an infinite loop.  All this adds to the length of the 
compiled program, and slows execution somewhat.  

Most people turn DEBUG off when the program is fully debugged so it will be as 
small and/or as fast as possible.  The problem is that turning DEBUG off can 
have unexpected, sometimes subtle, sometimes dramatic side-effects.  These in-
clude erroneous responses to mathematical expressions, and programs failing to 
compile with an "Expression too complex" error, even though the expression in 
question may be a simple constant value.  

I discovered the erroneous results bug when a 3-D Fractal Landscape generating
program I was translating for BIG BLUE DISK drew wildly different pictures with
DEBUG off than with DEBUG on.  It was as if the whole concept of graphics 
coordinates had changed on me.  With a program that does NOT do graphics, but 
instead produces numeric results, this might go unnoticed until it wreaks havok 
with a business report, or possibly even serious or fatal damage to a person, 
should a doctor use a QuickBASIC program to manage a patient's drug dosages.  
After all, the program worked just fine in all tests while being debugged, and 
a simple DEBUG option isn't supposed to affect calculations.  

Microsoft, this bug is FAR more serious than you perhaps realize.  Lotus is 
being sued right now for a quarter-million dollars on a claim that 1-2-3 failed 
to calculate a spreadsheet correctly, and if that suit succeeds, you and many 
other software developers WILL be held liable for damages resulting from pro- 
grams and languages which do not perform as advertised.  The legal validity of 
the common "as-is" warranty is being questioned -- many attorneys say that an 
"as-is" warranty is legally no warranty at all.  I suggest a recall of Quick-
BASIC 2.0 and a release of a fixed version, free to all registered users.  

Until this occurs, if you program in QuickBASIC, for now leave the DEBUG flag 
on, even after the program is fully debugged.  QuickBASIC seems to work fine 
that way, and the only penalties are slightly slower execution and larger 
compiled code.  If you MUST have the faster speed and/or smaller code, subject 
your program to another extensive round of testing after you turn DEBUG off to 
be sure it still produces consistent results.  

                           --------------------------

HANDY TIP:  If you have a MONOCHROME monitor or B&W TV available, you can 
easily check to see if common objects pose a threat to the life and limb of 
your precious data on your disks.  Magnetic fields have been known to inflict 
severe, permanent amnesia on floppies.  Say you need to open the case of your 
computer to install a new board or some more RAM, but you don't know if the 
screwdriver you are using is magnetized or not.  Simply wave it in front of a 
monochrome monitor or B&W TV with a display on-screen.  Anything with a mag- 
netic field powerful enough to damage a disk will cause the picture to bend and 
twist as the object passes by.  DO NOT TRY THIS ON A COLOR MONITOR OR TV!!!  
This will cause lasting, but correctable, discolored areas on the screen.  If a 
color tube has such a discoloration on it, a repairman can fix it quickly and 
inexpensively with a "de-gausser" (a special de-magnetizer).  

                           --------------------------

That's all for this issue; if you have any hints, tips, suggestions, or 
requests for help on a PC-related topic, please send them in to us; see the 
article, How To Disk Us, for details.  
