winzip icon

The FIMA (FIle MAnager) routines

Email
Submitted on: 1/1/2015 2:59:00 AM
By: Brad Stowers (from psc cd)  
Level: Intermediate
User Rating: By 4 Users
Compatibility: Delphi 5, Delphi 4, Pre Delphi 4
Views: 2059
 
     I have been using Delphi for several years in writing software for clients and have developed some routines that I have found useful in many of these applications. The applications are mostly databases in which the user did not want all the restrictions imposed by the usual off-the-shelf programs. I have recently retired and decided to turn some of the routines into Delphi components and they are the ones included here -- The FIMA (FIle MAnager) routines. In addition to the components themselves, there is a help file, a 'Create Wizard' that will create various kinds of empty files that represent the early stages of a database system, a program to test the appearance of the SelKey component, a utility program to compress vfiles and a sample application. IDGen This component supplies record id's for files. When a new record is needed, call the Pop method of this component to get it. Here we use non-negative longints as record id's. The component allows, but does not require, id's from deleted records to be recycled. Ffile This component is for handling records with fixed lengths. Usually the record is a record structure that has a predictable number of bytes. The file just packs these one after the other. The methods allow for insertion of new records, deleting records and editing and other housekeeping. Vfile This component is for handling records with variable lengths. Usually the record has some fields with unpredictable lengths, like memos or blobs. The records are not kept in any particular order and can move around when users change their lengths. The file has a companion 'locator' file that keeps track of where things are. In most cases you will have to tell the component the size of the records you are inserting or restoring. Records are transmitted to buffers you provide and there are methods that let you know how big to make the buffer for a record. IDSet This object allows you to work with sets of id's, important when the id's can be used to fetch records. The methods allow for insertion of new id's into sets, deletion of id's for sets and combining sets in various ways. Use this object by inserting a 'IDSetU' name in the uses clause of your program. Key This component allows the manipulation of and long term storage of very long lists of shortstrings. These lists can be used by SelKey (see below). Each shortstring (called a key here) has an associated keyid, a longint that can be stored in a database instead of the string. This may result in considerable savings in space. Methods allow easy translation from keyid to and from the string. In addition the user may assign the record identifiers of one or more records to a key and manipulate the list in various ways. Provisions are made to treat the strings as primary or secondary keys for records. SelKey This component allows the user to select one or more keys from a Key component. A long list appear and the user has powerful navigation tools to quickly scan the list for choosing keys. The programmer can then use the assigned id's to fetch the records for viewing and editing. To get a feel for how this works run the TestKey program that comes as part of the FIMA packet. Includes full source code, help file, and demo. By Len Bruening.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.