home *** CD-ROM | disk | FTP | other *** search
- V_ARRAY.ZIP Contains the following files:
-
- VIR.H 2351 - Header file for virtual array functions
- VIR.OBJ 4911 - Object file containing virtual array functions
- PRIMES.C 2325 - Prime number generator source code
- PRIMES.EXE 65392 - Prime number generator program
- README.TXT 4079 - This text file
-
- The program PRIMES is a demonstration using a virtual array. To run
- the program, simply type PRIMES at the DOS prompt. You will find that the prime
- number generator quickly generates a large volume of primes. To stop the pro-
- gram, simply press a key (I suggest <space>). Whatever key you hit will be
- passed on as if it was typed at the DOS prompt.
-
- PRIMES produces a file containing each prime number it generates. The
- prime numbers are stored as an array of long integers. PRIMES is capable of
- producing a list of all prime numbers less than 2,000,000,000 if you have the
- file space for it. Since such a large volume of prime numbers would take some
- time to compile, PRIMES has been designed to pick up where it left off when it
- is restarted. The file containing the prime numbers is named PRIMES.DAT.
-
- The virtual array functions in VIR.* are designed to allow access to
- an arbitrarily large array. Any type of data or structure can be accessed with
- these functions. Array access is straight forward, allowing your code to be
- simple and uncluttered. All disk caching / swapping is done automatically by
- VIR.
-
- VIR doubles as a buffered file access method. Since the arrays that
- VIR produces become disk files, any disk file can be accessed as an array of
- elements. (For instance, characters, data records,..) VIR has provisions for
- file sharing such as locking and unlocking groups of elements or denying access
- to files. In fact, VIR was developed as the primary file access method for a
- multi-user relational data base.
-
- When initializing a virtual array, you are required to specify the
- buffering characteristics. By altering these, you can achieve significant
- improvements in overall program performance as well as insuring automatic
- transaction reversal (Requires TTS) in the event of a program crash.
-
- Since VIR takes care of all these nasty details, your application can
- get on with nifty algorythms such as shown in this demo. In fact, with an extra
- macro or two, you can access a virtual array almost the same as if it were a
- simple array.
-
- BUT ENOUGH EXPLAINING....
-
- The purpose of this demo is to bring in a couple dollars and give out a
- nifty little bit of code. Feel free to use these functions in any of your pro-
- grams. (if you can figure it all out.) It was compiled using the SMALL memory
- model under TURBO C V2.0. I wish to ecnourage you to evaluate them. GOOD LUCK!
-
- If you come up with anything really nifty using this limited version,
- it would be nice to see my name mentioned in your source credits. I would also
- like to see a copy of the program and any comments you might have on how to
- improve the functions.
-
- Feel free also to pass this demo on to anyone you think might have a
- use for it.... especially other BBS's! However, all of these files must remain
- intact and complete!
-
- If you really want to be able to use these functions, simply send $10.00 to me:
-
- Peter G. McNeil
- c/o Persnickety Inc.
- 22446 Davis Drive #187
- Sterling, Va. 22170
-
- PHONES:-----------
- DAY (703) 450-6727
- EVE (301) 725-3239
- FAX (703) 450-5574
-
- FOR THIS YOU GET!!!
-
- - Complete source code for the VIR fucntions.
- - An explanation of each function and it's use.
- - A discussion of the caching/swaping algorythm.
- - A discussion of mult-user file access methods using VIR.
-
- PLEASE SPECIFY 3.5" or 5.25" disk.
-
- If you are a teacher and you want to use this in your class, I would be so
- tickled that I would send it to you for free! Just send me a letter on official
- letter head and it will be on it's way.
-
- This code represents a lot of thought, develpment, testing, and
- frustration. I hope it comes to some good use for you. It has proven very
- useful to me. Thanks!!