On Fri, 3 Mar 2006, Paul Carvalho wrote:

        [...]
> ie.frame('MainWindow').checkboxes.each { |x| x.set }

> The only problem is [...]a checkbox *may* be disabled [...].  In that
>  case, [...] it spits out an 'ObjectDisabledException' [...]
> there a quick and easy way that I can get this loop to just skip any
> disabled checkboxes and continue?

 ie.frame('MainWindow').checkboxes.each do |x| 
   begin
     x.set 
   rescue ObjectDisabledException
   end
 end

> [...]  Do I have to expand out the loop and
> insert 'rescue' lines?

 ie.frame('MainWindow').checkboxes.each { |x| x.set rescue true }

http://redhanded.hobix.com/bits/myFavoriteBadPractices.html


> Paul.

        HTH
        Hugh
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to