Download AMOS AlphaBasic (old)
Transcript
PICCESSING INDEXED SEQUENTIAL FILES Alphasasic has the ability to process inde,ted sequential files by linking to the ISAM assembly language package which must reside wither in system individual memory or user memory. Multiple directory files are supported via sane elementary 1SAM statements which allow the direct control of index file and file items. The ISAM package data as implemented requires more direct user control over the files than other implementations fOr two main reasons. The major reason is memory limitations which restrict the amount of "smarts" that could be put into the Aiphaeasic runtime package for handling ISAJI files. The second reason is the current structure of the existing iSl½r,4 package which precluded a more extensive implementation within the timespan allocated to the project. We feel that the version we are releasing will.provjde sufficient control for all users even though the initial training and programming may at first appear more complex than other versions of ISAM handlers. For more detailed information on ISAM files and the ISAM assembly language package the user is referred to the separate manual titled "ISAM System User's Guide". FILE STRUCTURE An indexed sequential file consists of one data file and one or more index files which link to the data file. The data file is structured identical to a normal random access file with the additional restriction that all records which are not currently active are linked to each other in a chain called the "free data record list". All data records reside in the data file and the data records may be any size up to the maximum of 512 bytes. As in the normal randan access file, data records will not be split across physical 512—byte block boundaries in the file. Index files are arranged in a balanced tree structure and contain one symbolic key for each active datacomplex record plus a link to that data record in the data file. This link is the relative record number and is used in the same manner as its counterpart in a normal random access file. The index file also contains an array of internal linkâ which comprise the sequential access tree structure. No references used in this manual may be confusing if they are not understood. References to an "indexed file" are made when speaking of the entire file structure in general including the data file and one or index files. References to an "index file" are used when specifically speaking of the portion of the structure which contains only the symbolic keys and the tree links. Index files may be primary or secondary and have the extension ilJX. All indexed sequential files must be created by the ISMBLD program prior to access by any AlphaBasic program. There is no method for the creation of a new indexed file within the Alphabasic language since this would require a prohibitive amount of seldom—used code for execution. The user may, however, create indexed files in a system structure by using the feature that allows a BASIC program to create and then execute a coirrand file. This coinriand file could set up parameters and then call the ISbSLD program to perform the actual creation of the files. For compatibility with existing structures the data file must have an extension of I1 and all index files must have an extension of IDX. There must be at 61