Search for a Borrower

Search for a Borrower

Interface Definitions

Inputs from the user:

Outputs to the user:

If Successful:

If "long" was chosen, then all information in each matching borrower's record is displayed.

If "short" was chosen, only essential information from each match is displayed, i.e.:

Data Abstractions

Design

Sub-Modules

Error Handling

Search Unsuccessful:

Syntax Errors in ID or name:

Imports

Exports

Pseudocode/Visual Basic Code

Search for Borrower

search screen appears

if (cancel) then exit search
if (search) then
   if (id incorrect syntax) then 
	errorbox "Id number is of incorrect form.  It must be an integer."
	return to text box to be edited
   else (syntax is correct) then
	if (long version) then
		clear listbox
		if all search fields are empty then do not populate list box
		if (at least one search field is nonempty) then
			find all borrowers which match all of the nonempty fields
		end if
		if the search is successful then
			populate listbox with the name, address, phone, id, books  borrowed,outstanding fines displayed
				of each matching entry
		end if
		if the search is unsuccessful then
			listbox remains blank
		end if
	end if
	if (short version) then
		clear listbox
		if all search fields are empty then do not populate list box
		if (at least one search field is nonempty) then
			find all borrowers which match all of the nonempty fields
		end if
		if the search is successful then
			populate listbox with the name, id and outstanding fines 
				of each matching entry
		end if
		if the search is unsuccessful then
			listbox remains blank
		end if
	end if
   end if
end if



Back to the Borrower Functions Index