Interesting Experiement gone wrong

  • Thread starter Thread starter Nick Randolph
  • Start date Start date
N

Nick Randolph

I was wondering why my app was not functioning correctly. After a little
bit of debugging I came across the culprit line:

dim i as integer = Val("13d")

Now this should work and i should equal 13 (or at least it does on the full
framework), however it throws a FormatException. I experimented and in fact
it is only when the number is followed by a d or e that an exception is
thrown.

I was wondering if anyone had come across a similar problem with Val? I
might add that I tried Integer.Parse and it generates the same problem. I
also tried it on both the PPC2003 emulator and a 2003 device.

Nick
 
Hi

Without looking at your specific scenario I can tell you that Val is
slightly broken in the CF...
http://groups.google.com/groups?hl=...soft.public.dotnet.framework.compactframework

Although I am not an advocate of this function and usually it is not hard to
write a substitute on a case by case basis, I do think Microsoft should at
least acknowledge the problem and if not fix it then better remove it
altogether.. The problem is that in its current state (discrepancy with
desktop & VB6 implementation) it can lead to subtle and hard to find bugs...

Cheers
Daniel
 
Back
Top