Organisation of Data
Organisation of Data
1 3 7 2 8 6 4 5
FILE DESIGN Variable length records
RECORD STRUCTURE for FILE Contacts.txt Records containing one or more fields that Indexed sequential file access
Field can be of differing lengths in each record, to
Data Type Length Description suit the size of data to be stored.
Name Indexes to file data allow direct access to
Contact ID Integer Auto number Unique ID number Often used for text fields that can be large, or grouped data, e.g. location of first record,
for fields that vary greatly in length. with an ID in range > 040 AND < 050.
Contact first name The grouped data would then be read
Initial Character 1 DIM Description AS STRING (No limit to
initial sequentially. Both the index and the file must
length of Description).
Last name String 25 Contact last name be sorted by key field.
Advantage: the records will be smaller and
Contact e mail will need less storage space/will load more
Main Index Index 040 Index 047
E mail String 50 Key Index Key Index Key Index Actual
address quickly. But a calculation will be required location location location Data