★ APPLICATIONS ★ BUREAUTIQUE ★ MICROFILE (POPULAR COMPUTING WEEKLY) ★ |
Data Remember (Popular Computing Weekly)![]() | Completing the file (Popular Computing Weekly)![]() |
Part One of a powerful filing program by Peter Patton Microfile is a data filing program for the CPC464, which will allow you to create data files with up to IS fields of 50 characters, which is more than sufficient for most home and small business applications. The program will prompt you every step of the way, but the following points should be considered carefully. Cassette data files are slow and cumbersome things to use, and for this reason the program holds it entire data file in memory. Data is stored dynamically, that is without waste, so although you may set up a data file in which records can hold up to 750 characters, only the actual characters entered into such records are placed in the file and the unused portion at the end of a data field are ignored. Each time a data file is loaded into memory, a routine within the program checks to see how much memory space remains, and allocates the correct number of free records available for the current working session. In order to reclaim the free space it is necessary to Save the data file, and then re-Load it. This means that if you start a session you may have, for example, room for 100 new records. If you were to enter 20 new records the free record counter would tell you that you have space for 80 more records. However, if you Save the file and xe-Load it again, then the free record counter may tell you that you now have space for 95 records. This does not mean that 15 records have been lost, it merely indicates that that much free space has been reclaimed. In this way it is not inconceivable that your files may exceed 1000 data records, all of which are held in memory at the same time. When deciding how your data file is to be structured, you should first sit down with pen and paper, and decide what sections or fields your data can be broken down to, and how many characters the largest single data item will take. In this way you will find that your files are laid out in the way which optimises the storage method outlined above. For example, if you wish to create a file which will hold names and addresses, you may decide that you need these data fields:
Similarly, if you think you'll play it safe and make the fields all of the maximum 50 characters, you will reduce your initial file capacity to some 47 records, thus you will spend much unnecessary time Saving and re-Loading the file in order to create more free records. So you can see that five minutes with pen and paper, can save many hours of frustration later. A typical example of the same file, structured with care may be:
Some programmers like to be able to press a single key in answer to a program prompt. Which is fine if the person using the program presses the correct key. My own personal view is that people often press wrong keys, and so you will find that all inputs in this program require you to press Enter before any action is taken. This causes little or no inconvenience, and at the same time allows you to change your mind if you select the wrong key. If at any time you enter a wrong key, it may be cancelled by pressing the Del key. However, this is destructive,, and will erase any character it passes over, placing a star where the character was. The stars are not a part of the input, so don't worry if you leave them at the end of a data field. If you wish to carry on typing, they are simply typed over. An input ends wherever the cursor is when you press Enter. PopularComputingWeekly841115 |
| ![]() |
|