Dim v as Variant
v = 0.5
if (v > 0) then
msgBox "This will not be displayed"
end if
if (v.doubleValue > 0) then
msgBox "This will be displayed"
end if
if (0 < v) then
msgBox "This will not be displayed either"
end if
if (v > 0.0) then
msgBox "But this will be"
end if
Whups. The compare should be converting the parameters to the most
precise type. Instead, if one of them is a variant, it is converting
the variant to the same type as the other parameter.
Looking very carefully at the documentation, I find this is mentioned
in passing at the very bottom of the variant explanation. However, a
landmine like this needs to be redflagged with a big "Danger Will
Robinson!" message and an example of what not to do.
--
===========================================================
Robert Woodhead, CEO, AnimEigo http://www.animeigo.com/
===========================================================
http://selfpromotion.com/ The Net's only URL registration
SHARESERVICE. A power tool for power webmasters.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|