Re: Val() versus CLng, CInt or CByte



Donald Lessau wrote:

"dpb" <none@xxxxxxx> schrieb im Newsbeitrag news:fg7aiu$mf$1@xxxxxxxxxxx
Donald Lessau wrote:
"Steve Gerrard" <mynamehere@xxxxxxxxxxx> schrieb im Newsbeitrag news:Q4ednZ36GKyrLLvanZ2dnUVZ_gWdnZ2d@xxxxxxxxxxxxxx

Val is nice because it it will read a number followed by text, i.e. 23A becomes 23, instead of tossing up an error...

... which also has a dark side: e.g. Val("23E2") -> 2300, and Val("23E-2") -> 0.23

What's the "dark" side of correct interpretation of a floating point exponential notation??? (Puzzled as to why one would/could possibly expect/want any other result...)

I referred to the statement of the previous poster:
Val is nice because it it will read a number followed by text...

If you use Val to grab numbers from the left end of strings (a quite common usage of Val it seems to me), you might be surprised by the returns when the string happens to look like an exponential notation.

Would be far more surprised if it _didn't_ return the proper result when parsing a character string which does "look like" exponential notation.

--
.



Relevant Pages

  • Re: Val() versus CLng, CInt or CByte
    ... common usage of Val it seems to me), you might be surprised by the returns when the string happens to look like an exponential notation. ... when parsing a character string which does "look like" exponential notation. ... I think Donald was referring to surprise someone might get parsing a set of code numbers where the digits in front of a letter were being sought and where the code numbers were something like this... ...
    (microsoft.public.vb.general.discussion)
  • Re: Val() versus CLng, CInt or CByte
    ... common usage of Val it seems to me), you might be surprised by the returns when the string happens to look like an exponential notation. ... parsing a character string which does "look like" exponential notation. ... I think Donald was referring to surprise someone might get parsing a set of code numbers where the digits in front of a letter were being sought and where the code numbers were something like this... ...
    (microsoft.public.vb.general.discussion)
  • Re: (*) and List Directed I/O
    ... Richard Maine wrote: ... of a character string could be accessed as b, ... of a character array notation for). ... It doesn't follow the: notation so well, ...
    (comp.lang.fortran)
  • Re: bush tax cut and small businesses
    ... >>I adopted your notation, which is confusing. ... >"Generally speaking, the symbol f refers to the function itself, while ... y=yis common usage. ...
    (sci.econ)
  • Re: Val() versus CLng, CInt or CByte
    ... instead of tossing up an error... ... exponential notation??? ... (Puzzled as to why one would/could possibly expect/want any other result...) ...
    (microsoft.public.vb.general.discussion)

Loading