Well I don't have VB right now but I'll get the printscreen as soon as I can...
to tell you the truth that bug happend when I used an array of strings... when I called one of those variables inside the array I had the bug..
something like this:
dim A(10) as string
dim B as double
A(2)="123.45"
B=Cdbl(A(2))
as for phReAk's code... I don't think is the correct way to use since I chose double variable because I had very large (and no way to now their size) numbers, so I can't use integers...
well... maybe, but the problem is I don't know how long will the number be (in the program) so I'll have to figure out a way to convert it ... (witch isn't that difficult - but it totally messes my code up)...
..
And since there is a function that SHOULD do this I don't see why I shoul develop new code....
..
but for what I'm seeing I'm the only one with this problem... so I'll soon get a print screen and see if there's more to it (??- I doubt)
..
Another thing ... I have no patches installed!! so it's VB6.0 Professional original..
Believe me if there was a bug with CDBL it would've been noticed before version 6 sp 6...
I think you'll find there's a problem with your code and you're not passing the number to the CDBL function correctly.
Why not put a breakpoint on the CDBL command, and when the program hits it use the DEBUG window to discover what is being passed to the function...?
'Buzby'
Visual Basic Developer "I'm moving to Theory. Everything works there."
Stop blaming CDBL - there's nothing wrong with it - post the code you have in your project and we'll take a look.
Or but a DEBUG.PRINT [variable name] before the CDBL line to see what is actually being passed into the CDBL function.
'Buzby'
Visual Basic Developer "I'm moving to Theory. Everything works there."
...
... ok... here are the examples...
...
as you can see I kid you not... only the last worked... probably it has to do with assuming "." instead of ",".... but still it is a bug!!!
As you can see, the msgbox tells you "123,45" and not "123.45". Try with a comma instead of a dot.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Well ... the thing is: in my project I import the data from a txt file and I can't control if the data inserted in the txt file is using "." or ","... so when I use the Cdbl(Variable) (being variable the data imported) I would expect it would recognise the data...
It may not be a problem unless I use a computer with a diferent language of windows installed... If I use the program in Win XP (English version) I would get the oposite... So I would have to know wich version of the windows is installed to be abble to convert right!!!....
Wich totally SUCKS ...
That's Why I hate Mcrosoft!!!
now that I got that out of my chest ... do you know of another function that converts strings to doubles (without bugs)???
By the way Buzby sometimes they also make mistakes!!
If you regional settings says that the "," is the decimal separator, then the "." would be interpreted as a thousand separator.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Who says it does not? It did recognize it as a thousand separator. When dealing with number the thousand separator "does not exist". So, "123.456" would be a string value, but its number would be 123456.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.