A Program for ya

 BBS: Inland Empire Archive
Date: 02-15-93 (15:17)             Number: 327
From: MARK HARRIS                  Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: A Program for ya               Conf: (2) Quik_Bas
Here's some code I wrote for everyone to bash around.  It's a
prime numbers generator (I caught a message a week or two about
that, and had it on my mind).  Be warned:  this is NOT a very
good generator.  It's horribly slow, for one thing; I've written

some much, much faster.  The problem with those, however, is that
you're very limited as to how many numbers you can generate; you
run out of array space too soon.

So, this one reads and writes to a random access file, which
slows it down, but allows you to keep doing it until your hard
drive is full.  Or, until you really get sick of it.  Try running
the program overnight, if you have the hard drive space, and see
what you get.

The reason I wrote it was basically because I wanted to start a
discussion, preferably with code flying, about writing programs
with that "professional look".  So I made use of some subs,
listed separately, originally written by Mark H. Butler last year
and placed in the public domain.  (Very nice job, BTW Mark!)

Copy and paste the main module together, then do the same for
Mark Butlers' subs, and after you load the main module (my code),
then use the "Load" function to include Mr. Butler's code.  It
does run somewhat better and faster if you compile it, but
it really doesn't make a huge difference.  You're still limited
by the speed of your disk drive.

I checked it all out in advance, running it in both the QB4.5
environment and compiling it and running the stand-alone .EXE.
I didn't find any bugs, and mostly, it came out the way I wanted.
I tried it in the Qbasic that comes with DOS, but it DOESN'T run
in that environment.  Sorry about that for those of you limited
to that environment.

(Just a note:  it took me about three hours to finish, so I don't
really have much in this program)

Have fun!


Mark R. Harris

... OFFLINE 1.50  "... I spilled spot remover on my dog.  He's gone now."

--- MsgToss 2.0d(beta) 12/17/92
 * Origin: JW-PC Consulting DataFlex.HST (608)837-1923 (1:121/8)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET