# this method deletes a file def deleteicseventrecord require 'fileutils' if @a_viewicsevent $currenticseventtext = @a_viewicsevent end begin # exception trapped block fileName = $rwdschedule_directory + "/" + $currenticseventtext + ".ics" File.delete(fileName) @eventicsfilechangeresult = "#{$currenticseventtext} File Deleted!" rescue @eventicsfilechangeresult = "File Deletion error" end # exception rescue end