In one of my scripts that checks the web page size and load times, I didn't factor in the size of the graphics because in most cases they were negligble. However on some reports, the whole page is mostly made up of a large chart image. In that case I wanted to include the image file size as part of the "page size". Here's the line of code I use:
page_size = $ie.frame('MainWindow').html.length + $ie.frame('MainWindow').image(:index, 2).fileSize.to_i
The question I have is why "length" returns a number but "fileSize" returns a string (of a number)? It took me a minute to figure out that fileSize was returning a string and that's why the sum was failing. Once I appended the ".to_i" it worked fine.
Is this by design? It just seems a bit inconsistent to me. Since I don't know the history of this function I thought I'd ask. I haven't explored any other functions that return numbers to see if they are also strings.
Paul.
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
