# this method views an existing address record def loadnamerecord require 'fileutils' @a_filename = $currentnametext begin # exception trapped block fileName = $addressfiles_directory + "/" + $currentnametext + ".nam" fd = File.open(fileName,"r") @a_name = fd.readline.chomp @a_address = fd.readline.chomp @a_citystatezip = fd.readline.chomp @a_phone = fd.readline.chomp @a_email = fd.readline.chomp @a_comment1 = fd.readline.chomp @a_comment2 =fd.readline.chomp @a_comment3 = fd.readline.chomp while ! fd.eof? @extranamedatadisplay = fd.readline end fd.close rescue SystemCallError, StandardError $stderr.print "system call error: " + $! end # exception rescue end