Prime Number prog

 BBS: Inland Empire Archive
Date: 02-15-93 (15:17)             Number: 326
From: MARK HARRIS                  Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Prime Number prog              Conf: (2) Quik_Bas
------------- CUT HERE ---------------

'written by Mark R. Harris on February 15, 1993
'and uses some routines included as a module
'originally written in 1992 by Mark H. Butler,
'which he then placed in the public domain.
'Please take note that I only used the subs
'I wanted, and cut out the rest. Sorry, Mark.
'The code written here by me is also placed
'in the public domain on February 15, 1993,
'so you can do whatever you'd like with it.
'The purpose here was NOT to make a super-fast
'prime number generator; reading and writing
'from a random access data file just won't
'allow for much speed.  Rather, I wrote this
'to provide some code for others to work on,
'and deliberately wrote in some bells and
'twistles, just to add a professional kind
'of look to it.  I feel such a look is very
'important, and took the opportunity to present
'it here with the hope that others might find
'this useful.  Even at that, this program could
'stand a lot of improvement, and I'd like to
'hear from anyone who has written code to
'improve the basic program.
'Write to: Mark R. Harris
'          273 Park Ave.
'          Prairie du Sac, WI 53578
'or, NetMail me at 1:121/26 or
'1:121/8 on the Fidonet.

DECLARE SUB (count, Total, n)
DECLARE SUB Endprogram ()
DECLARE SUB View.primes (count)
DECLARE SUB Introscreen ()
DECLARE SUB SetDisplayScrn (Total, n)
DECLARE SUB Explode (UpRow%, LtCol%, LoRow%, RtCol%)

CONST Black = 0     'These are the colors
CONST White = 7     'used in the program
CONST Ltblue = 9
CONST Ltred = 12
CONST Yellow = 14
CONST Starwhite = 15

TYPE primenum        'Setup for the random
   primedat AS LONG  'file I'll use for the
END TYPE             'prime numbers

DIM Storenum AS primenum

COLOR Black, White   'Sets the background color,
                     'and clears the screen

COLOR Starwhite, Ltblue  'Set the box color, and
                         'put the box on the
Explode 7, 20, 14, 60    'screen
LOCATE 8, 29
LOCATE 10, 35
LOCATE 12, 28
COLOR Yellow, Ltblue
PRINT "Press any key to continue";


CALL Introscreen 'Just another set of screens
                 'which explains the program
COLOR Black, White

... OFFLINE 1.50  "... No wanna work.  Wanna bang on keyboard...."

--- 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