[comp.databases] Ugly programming: some examples

mithomas@bsu-cs.bsu.edu (Michael Thomas Niehaus) (04/24/89)

Well, we finally did it.  This weekend we completed our dBase project.  In its
entirety, it comes to about 7000 lines.  Yes, we did all development in dBase
III+, and we used the BRIEF editor (from UnderWare, Inc. -- no kidding).

We ran into several problems along the way: it seems that sometimes dBase
loses track of file handles, reporting that too many files are open.  Now,
if you quit dBase, and then get right back in and run the same routine again,
there are no problems (and this is not because of other open files: we put
a CLOSE ALL at the top of every module).  Also, we noticed that our database
files become corrupted under non-duplicatable circumstances.  And we found
out that dBase can normally only handle 7 layers of nested IFs.  It also
appears that dBase ignores the rest of the line after it has found a valid
command, so comments could just be put out on the line somewhere.  It
also does a poor job of reporting errors (if you miss an ENDIF or an ENDO
[which, by the way, appear to be interchangable at times] or forget the
periods before or after an AND,OR, or NOT, for example).  Other problems are
too trivial to mention.

We managed to write two modules that defy the limits of the dBase language:
one prints a Gantt chart, and another figures out a critical path table.
I wrote the critical path module, so I am quite proud of it.

To get around the 256 variable limit, I had to read in the data by having the
user enter paths through the path diagram, which I saved in memory variables
that were saved to disk.  When I needed to access that row, I would write
the current one to disk, and read in another.  So in actuality, the implemen-
tation is a list of arrays (or an array of pseudo-linked lists).  It's
very ugly and highly I/O intensive, but works quite well.

I am interested in hearing what other strange applications have been developed
in dBase.  Feel free to send me e-mail.  I enjoy hearing dBase horror
stories (I know I have many that I could tell myself).

-Michael Niehaus


-- 
Michael Niehaus        UUCP: <backbones>!{iuvax,pur-ee}!bsu-cs!mithomas
Apple Student Rep      ARPA:  mithomas@bsu-cs.bsu.edu
Ball State University  AppleLink: ST0374 (from UUCP: st0374@applelink.apple.com)

emuleomo@yes.rutgers.edu (Emuleomo) (04/25/89)

> We finally did it. We wrote over 7000 lines of DbaseIII+ code....
>
You are kidding me right. Even if you are serous, I hope the final application
will not be run using DbaseIII+. 
Well I hope you know that your application can run 6 times FASTER without
changing a SINGLE LINE of CODE, if you 

  	a. 'FOXBIND" the whole shooting works.
	b. 'FOXPCOMP' the resulting text file.
	c. FOXPLUS the resulting ".FOX" file.


--Emuleomo. O.O.

** A stitch in time saves NINE!!.  Use Foxbase+ ***