yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Errors with text files
I'll give you some offhand reflections...
- You should know what point in the code has generated the overflow error. (Do you know it? If you don't, thare are some techniques to get it). The error could be bypassed either from within the code or from within the text file values. I'll try to explain it better.
Let's suppose we read the value 33000 from the text file. I could dim a Long variable to store it, or I could write a lower number into the text file. It depends on how the text file is generated and how its values are used (you didn't tell us).
- If the text file has been generated by your VB application, it could be some IDE/Exe conversion trouble, and this is tricky to identify. For instance, once I cranked my head on a Type mismatch error when reading an INI file. This file was updated during previous app-unload phase, and contained the value of some variables. Only, when I ran the .exe, the variable values were correctly stored, but when I ran the app into the VB IDE, the boolean values were translated into the local language of the pc, so it wrote "Vero" or "Falso" instead of "True" or "False". It took me one week to locate the error. You may want to check for a similar case.
- In general words, even if you declare a numeric variable, VB internally uses a Long or a Double variable (...from MSDN...), so you'll have no relevant advantage to declare an Integer or a Single. Then in most cases you can convert your variables into a larger type with no regrets.
- If at the end you discover the problem is due to machine's installed charachter set, you may include your desired charset into a setup package with your app, and deliver it to your users.
Hope it helps
____________________________
Real Programmer can count up to 1024 on his fingers
|