
		3EIT MUSIC LIBRARY CATALOGUE - RECORD LOG MODULE

			 by MATTHEW RICHARDS , 27/1/95.


	The RECORD LOG module of the MUSIC LIBRARY CATALOGUE must store matched records, as desired, to be viewed after the search. It must provide the facility to view these records, and delete them for a new search.


			         USER MANUAL 

	The program can executed in as 'stand alone' module called "log_store". When executed the user interface panel is set up and displayed. By clicking the mouse over an entry line (which correspond to fields in the catalogue), for example 'artist', the operator can type in a corresponding example, for example 'Bach'. When entries have been made for all (or only some) of the entry lines, these entries can be stored for later reference by depressing the 'save record' button with the mouse.
	This process corresponds to when a search has matched a record in the in the overall MUSIC LIBRARY CATALOGUE and is displaying it to the operator, so in the overall program the operator will not be required to input the names; they will appear. Then the operator has the option or saving this record (by pressing the 'save record' button, or discarding it and moving on to the next matched record (not covered in this module).
	Having saved the displayed entries (a record) the operator can type in another set of entries in the same way and save them as well. This can be done as many times as desired. The entered records (the log) can be viewed within the user interface panel at any time by depressing the 'display records' button. This then extends the user interface panel vertically and lists the entered records in the order that they were entered in, with the fields arranged alphabetically. The entries are displayed with their corresponding record number and field.
	The operator can type in some more records if desired, and so add to the log using the 'save record' button again, and view the revised log, again using the 'display records' button. The log can be added to in this fashion, and an up to date version of it displayed, as many times as is required.
	When a search is complete and the operator has finished with the log, and perhaps wishes to begin a new search, the 'new search' button should be depressed. This  distroys the log  and its display box ready for the operator to type in some new records for the new log. The new records can be saved and viewed as before.


			       PROGRAM MANUAL

OVERVIEW

	The program for the RECORD LOG module is called 'log_store'. It consists of three procedures and the interface set up commands.
	The procedure 'keep_record' takes an array containing the current record on display (the current entries) and adds them to the log, which is in effect a two-dimensional array. The procedure 'print_records' extends the user interface by addind a box to it,  and prints the log inside this. The procedure 'loose_records' destroys this log diplay box and resets the log array to zero.
	The interface is set up by creating four input lines with corresponding labels and three control buttons.

INTERFACE SET UP

i. Input  

	The four input lines and labels all follow an identical code structure, as exemplified by label '.label1' and entry line '.artist'. The label simply has name and text (the actual label) references attached to it. The entry has name, width, and appearance references attached to it and also a textvariable which stores the current entry to the array 'current'. These two identifiers are 'packed' (displayed) at the top available space with a 1mm gap surrounding each (for visual delight only). Labels 2, 3, and 4 with corresponding entries follow this format.

ii. Button controls 

	The button called 'save record' on the interface is "button .save" in the program. This has the reference command 'keep_record current' attached to it, so that when the button is depressed the procedure 'keep_record' is activated with the displayed entries, stored in array 'current' passed to it.
	The button called 'display records' on the interface is "button .print" in the program. This has the reference command 'print_records record' attached to it, so that when the button is depressed the procedure 'print_records' is activated with the log array 'record' passed to it. 
	The button called 'new search' on the interface is "button .loose" in the program. This has the reference command 'loose_records record' attached to it, so that when the button is depressed the procedure 'loose_records' is activated with the log array 'record' passed to it.
	These buttons are packed at the top available space with a 1mm gap surrounding each.

iii. Dummy variables

	The last three commands of the program create a label, box and scrollbar to aid the procedure 'print_records' which destroys them. This is a dummy creation and not a recommended programming technique. It is necessary because if the program is to display the updated log it must first erase the display of the old log. However, the first time that the procedure is activated there will be no old display to destroy, so a dummy one is created to overcome this.
	This technique is used at the end of the procedure 'loose_records' for the exact same purpose.

iv. Procedure 'keep_record'     

	The procedure 'keep_record' takes an array (of sorts, because they are really seperate variables) and adds all of its contents to another array, called 'record'. For this application the array recieved (called 'current' outside the procedure) is in effect one-dimensional, and 'record' is two-dimensional. When 'current' is passed it is called 'a' inside the procedure.
	Each time the pocedure is executed the global variable 'num' is incremented by one. It is set at the very begining of the program to one. The first dimension of 'record' is its record number 'num', creating "record1, record2, record3..etc..". The second dimension of the 'record' is the field, which is taken from the incoming 'current' record.
	Thus foreach entry in 'a', a new entry in 'record(number,field)' is added, containing the entry in 'a'. 

v. Procedure 'print_records'

	The procedure 'print_records' firstly destroys the display of the old log. Next the new display is created, consisting of a label (which is the title "matched records"), a listbox and a scrollbar. The listbox has to have its dimensions specified, because the default size is very thin.  
	Similarly to the procedure 'print_records', this procedure takes a passed array (in this case 'record') and stores it as 'a' inside the procedure. Then 'a' is sorted alphabetically, and for each entry in 'a' greater than zero, i.e. not empty, the entry is printed in the listbox.

vi. Procedure 'loose_records'

	Again, the procedure 'loose_records' firstly destroys the display of the old log, and takes the passed array 'record' and stores it as 'a'. Then, for each entry of 'a', the corresponding entry of 'record is set to empty. When this is complete all entries of 'record' are empty. The record number 'num' is reset back to one again.
	Dummy variables for a label, listbox and scroll bar are created to aid the next execution of the procedure 'print_records', now that the log display has been destroyed already.



	INTERGRATION INTO OVERALL MUSIC LIBRARY CATALOGUE PROGRAM

	This module has sucessfully been intergrated with the other modules to form the overall program. It has necessarily been changed to adapt to the overall application but still functions in the same manner. This module integrated into the overall program is listed in the attached file history.tk, for interest.



			    FUTURE IMPROVEMENTS

	I would like to have been able to save the log of matched records to a file, so that a printout of matched records may be possible. However, attemts to do this were unsucessful. I do not think that adapting the program to do this is very difficult, because the log is already being saved as a variable (array).

