Peter,
Yes, I get an overflow error trying to dimension an array using numbers
smaller than -2147483648 (lower limit for a Long).
The fastest times are for...
Scrabble = (UBound(V, 1) >= -2147483647) 'last digit 7 not 8
-2147483648 is automatically converted to a double by Excel
and is a smidgen slower.
-2 ^ 31 is slower yet.
However, as a practical matter, any function that works is fast enough. <g>
--
Jim Cone
Portland, Oregon USA
"Peter T" <peter_t@discussions>
wrote in message
Hi Jim,
First I can't claim that as "my" function. The basic method to test for the
existence of (say) UBound w/out error is long established.
In my first reply I had forgotten about the scenario of LBound(v) = 0 and
UBound(v) = -1, that would pass the sole UBound check but give incorrect
result without checking UBound >= LBound. That was catered for in Chip's
original function which I adapted.
Your UBound(V, 1) > -1.79769313486232E+307 removes the requirement to check
both bounds. If you conceived that it is indeed an original and I think
reliable method. So the accolade goes to you
I wonder though what the lowest theoretical UBound actually is, much more
than that lowest double. From light testing it appears to be the lowest
long, so maybe(?) your function could be changed to
Scrabble = UBound(V, 1) >= -2 ^ 31
Regards,
Peter T
"Jim Cone"