Re: Val() versus CLng, CInt or CByte
- From: dpb <none@xxxxxxx>
- Date: Tue, 30 Oct 2007 08:26:43 -0500
Donald Lessau wrote:
"dpb" <none@xxxxxxx> schrieb im Newsbeitrag news:fg7aiu$mf$1@xxxxxxxxxxxDonald 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.
--
.
- Follow-Ups:
- Re: Val() versus CLng, CInt or CByte
- From: Rick Rothstein \(MVP - VB\)
- Re: Val() versus CLng, CInt or CByte
- References:
- Val() versus CLng, CInt or CByte
- From: Jack
- Re: Val() versus CLng, CInt or CByte
- From: Steve Gerrard
- Re: Val() versus CLng, CInt or CByte
- From: Donald Lessau
- Re: Val() versus CLng, CInt or CByte
- From: dpb
- Re: Val() versus CLng, CInt or CByte
- From: Donald Lessau
- Val() versus CLng, CInt or CByte
- Prev by Date: Re: Reading out IE and Firefox bookmarks
- Next by Date: Re: Val() versus CLng, CInt or CByte
- Previous by thread: Re: Val() versus CLng, CInt or CByte
- Next by thread: Re: Val() versus CLng, CInt or CByte
- Index(es):
Relevant Pages
|
Loading