XPost: comp.programming   
   From: mynamehere@comcast.net   
      
   "code_wrong" wrote in message   
   news:44074b40$1_2@mk-nntp-2.news.uk.tiscali.com...   
   >   
   > interesting, you have made a comprehensive study of the flawed isNumeric()   
   > function   
      
   Since Rick posted his IsNumeric post, I will toss in mine as well :)   
      
   IsNumeric has one particular purpose, which it does well, so it is not flawed.   
   Its function is to determine whether or not a particular expression can be   
   converted to a number without causing an error.   
      
   As Rick points out, the test   
      
    IsNumeric("($1,23,,3.4,,,5,,E67$)")   
      
   returns True, which is correct, because the conversion   
      
    X = CDbl("($1,23,,3.4,,,5,,E67$)")   
      
   will assign X the value   
      
    -1.23345E+70   
      
   rather than raising an error.   
      
   In case you are curious, the conversion will ignore the commas and $, since   
   they   
   are allowed in numeric expressions, and it will treat the enclosing parentheses   
   as an accountant's version of a minus sign.   
   That gives it -1233.45 E67, which the VB immediate window then displays in   
   "proper" scientific notation.   
      
   IsNumeric is not meant to be, and quite plainly is not, a strict input parsing   
   function, but is rather a programming tool with which to avoid "Type Mismatch"   
   errors during conversions steps.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|