begin
$source_directory_name =
DATA.readline # Line # 8
rescue
puts %<"__END__" statement or subsequent directory-name missing
\nQuitting job>
STDOUT.flush
exit
end
class ReformChartNames
def initialize @source_dir_name = $source_directory_name.chomp
unless File.directory?(@source_dir_name)
puts %<ERROR: "%s" is not a valid directory name> %
[@source_dir_name]
exit
end
end
end
rcn = ReformChartNames.new
puts %<Got ReformChartNames object "rcn"> if $DEBUG
A bare 'rescue' is short for 'rescue StandardError', and catches only
sunglasses of that. If you want to rescue everything then 'rescue
Exception', but beware that also catches programmer errors, system
problems like out of memory etc.
Google "ruby exception hierarchy" for more.
To use DATA, put __END__ at the end of your code followed by the data
A bare 'rescue' is short for 'rescue StandardError', and catches only
sunglasses of that. If you want to rescue everything then 'rescue
Exception', but beware that also catches programmer errors, system
problems like out of memory etc.
Google "ruby exception hierarchy" for more.
To use DATA, put __END__ at the end of your code followed by the data
Thanks for your excellent response, not withstanding the sunglasses I
must have been wearing when I screwed up My delay in
responding, for which I apologize, occurred because I distracted by
another project.
Best wishes,
Richard
···
On Sep 11, 2:52 am, Brian Candler <b.cand...@pobox.com> wrote:
A bare 'rescue' is short for 'rescue StandardError', and catches only
sunglasses of that. If you want to rescue everything then 'rescue
Exception', but beware that also catches programmer errors, system
problems like out of memory etc.
Google "ruby exception hierarchy" for more.
To use DATA, put __END__ at the end of your code followed by the data
--
Posted viahttp://www.ruby-forum.com/.