DOCUMENTATION FOR LOGFILE v. 1.0a (May be freely copied for personal or classroom use; other use requires author permission) 1.0 Contents of This File 1.1 Capsule Specifications 1.2 Minimum equipment required 1.3 Features 2.1 First Words 2.2 Program Overview 3.0 Getting Started 3.1 How Many Records? 3.2 Connect-time Rates 3.3 Choosing a Filename 3.4 Use Code Option 4.0 Adding Records 5.0 Searching Records 6.0 Report Generator 6.1 Printer Support 7.0 Program Crashes 7.1 Killing Relative Files 8.0 Translation to Other Computers 9.0 Program Alterations ------------------------------------------------------------------------------- 1.1 Capsule Specifications File size: 720 records Record length: 254 characters and spaces; present format is 33 Purpose: To allow user to manage on-line connect times, uses, and charges, while demonstrating the use of relative files and keylists. 1.2 Minimum equipment required: C-64 computer 1540/1541 disk drive Printer optional 1.3 Features: Real-time clock display on main menu. Search keyfield using all relational operators--plus range--reduced to alpha-character mnemonics (>= becomes GE). Sequential keylist retrieves relative file records, with good execution speed. Keylist 'remembers' certain creation parameters, including date and time of last update. Retrieved data is plugged into pre-defined screen for reading. Prepares report with totals; may be either displayed to screen or printed. File status display from main menu of records used/available. Extensive input error-checking with entry restrictions. Modified 'get' statement with blinking cursor. Date & time string manipulation routines. Formal exit routine. User friendly and virtually transparent operation for non-programmer. 2.1 First Words Several terms are used in this text file with which you should be familiar. FIELD: A record 'blank space' reserved for an item of information. In relative files, the 1540/1541 disk operating system (DOS) dictates that one may have any number of fields provided the total of field lengths and separating characters or spaces does not exceed 254. FILE: The cabinet; not the manila folder. In Logfile--indeed, in all relative files--the user establishes a particular 'cabinet' into which he or she proposes to put individual records. The filename labels the 'cabinet.' KEY: The information stored in a keyfield. KEYFIELD: Normally the field into which the most important item of common identification is entered, as, a customer name. Ask yourself, 'By what field would I usually file this record?' KEYLIST: A sequential file of all the individual-record keyfields. In Logfile, by counting the keyfield sequence, keyfield x corresponds to relative record x. RECORD: Think medical records. The individual file folder within the file cabinet. May be an empty folder, or may contain information. Our cabinet may contain up to 720 records. Beyond that, we'll need another file cabinet. SEARCH: In Logfile, using a specified date, or range of dates, plus the relational operators (=, <>, etc.) to attempt a match to an item in the keylist. If the match is successful, the key's position in the sequential file dictates which corresponding full record is retrieved. 2.2 Program Overview Logfile is a relative file and keylist generator, for the C-64 and 1540/1541 disk system, formatted to keep track of on-line connect times and charges. Some months ago, your humble author realized, with shock, that not every computer owner is interested in programming. Logfile attempts to shed some light on what seems to be a neglected area of C-64/1541 literature, the relative file. Those few demonstration programs we have seen appear to relegate their users to remembering record numbers, or to relying on an exact and equal match with the field in question. There is no question that the equipment will support much more sophisticated operations than these, but no one has taken the time to tell the beginning or intermediate BASIC programmer how to proceed. Besides, BASIC is too slow for database management! Well, how slow is 'too' slow? We have the good fortune to own a commercial software package for the above equipment that will locate and display a record within three seconds, regardless of file size! Sure, it was written in machine language, but it also uses keylists. We submit that the keylist may be an excellent tool even for a database program in BASIC. Using a keylist, Logfile's retrieval speed may even surprise you! 3.0 Getting Started If you plan to use Logfile for its pre-formatted purpose, all you need do is load a working copy by entering the usual direct command, load "filename",8. Then run. We strongly advise you to preserve a master copy, and work from copies of that. After the initial screen, enter the date and time in the formats specified. This feature sets the main menu real-time clock and is further used to date-and-time stamp your reports, as well as to record the date of keylist updates. The main menu display is your route to other features of the program. 3.1 How Many Records? Before creating a new file, some thought should be given to the amount of data you may already have, or will be generating. For example, if you merely access CompuServe three times each week to send and read EMAIL, and want to keep track of your times and charges for a year, you will only need to 'declare' 156 records for the file. The major reason for doing things this way is to increase search speed. There is no need to declare a maximum of 720 records in a particular file if you aren't going to use them. 3.2 Connect-time Rates Another option is how you wish Logfile to deal with connect-time rates. The program will accept and identify a constant rate, as, 06.00 for $6 per hour. It will also accept a variable rate that may change as you build the file. In the first case, you will not be prompted for the rate in each record since you are telling the computer the rate will not change. The latter option asks for the rate in each record you enter. The program will 'remember' which option you chose, for your next session with that file. A word of caution. While eliminating all but letters, numbers, and some punctuation, our modified 'get' statement will accept punctuation other than the decimal point without error detection, as, the colon for time strings. The prompts will always tell you which separator or punctuation to use. In the rate case, any punctuation other than a decimal will scramble later calculations. 3.3 Choosing a Filename Since you are already acquainted with a massive information service that has a fetish for proper filenames, this should be easy. Most often, the name of the on-line service is adequate. Be aware, however, that upper and lower case are significant. If you originally enter 'DowJonesNS,' and later call for 'dowjonesns,' you'll get a 'file not found' error. Logfile limits you to a maximum of twelve characters and spaces, to have room for its own automatic extensions. The keylist will appear in your disk directory as 'filename.key.' The relative file will appear as 'filename.dat.' This way, the pairs of matched filenames reflect their purpose, and may co-exist on the same disk. Do not add these extensions; let the computer handle that for you. Logfile prompts you for a filename before executing any main menu operation so that, in addition to providing some internal requirements, you may choose, if you wish, another file. After the two files have been created, the only option is returning to the main menu. To verify that your files are on the disk, select the file status display. 3.4 Use Code Option Before adding records to your newly-created file, determine which personal use codes you may want to use. The program allows three characters for this. For example, if you invested 00:17 minutes searching public access for a discussion of keylists, ultimately downloading this text file, the code might be 'acc' (for access), or 'dow' (for download). Similarly, the cb simulator might appear as 'cbs.' 4.0 Adding Records Upon choosing this menu item and calling for the file, the screen will display a blank record, properly labelled with the filename, and advise this is 'record nmbr: 1.' Data entry is simple enough, with the aid of a blinking cursor and specific prompts. When one field is properly filled, the cursor will move to the next. If you elected to use a constant for the connect time, this field will be filled by the computer (in light blue characters on a color monitor or color tv). The charge calculation is also automatic, leaving the use code. When this field is filled, the 'save' prompt will flash. You may save the record, delete the record, or quit the add mode, as you prefer. Pressing 's' or 'S,' and that letter only will save the record. Following a successful save, a new prompt will appear in the command area under the record format, 'SPC enter next.' Press the space bar to display the next blank record, and continue as before. 5.0 Searching Records If this program has any real power, it surfaces here. After calling for the file, you are given the option of searching by record number (nothing more than specifying a specific record for retrieval), or searching by our pre-designated keyfield. Of the fields in Logfile's present format, only the date made any sense as a keyfield, although another is possible with a few modifications. Similarly, a sort routine was not...
Amiga7878