Help a Brazilian programmer urgent, please!

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 2
Reputation: Domus BRASIL is an unknown quantity at this point 
Solved Threads: 0
Domus BRASIL Domus BRASIL is offline Offline
Newbie Poster

Help a Brazilian programmer urgent, please!

 
-1
  #1
Oct 7th, 2009
Hello, I represent a company developing software in Brazil.

I wonder why my program (VB6)
reading a number stored in the notepad, it reads
the decimal number.

for example if the value is stored 30.5
will display the value in textbox 305

how to make it understand the point.


Thanks
Last edited by Domus BRASIL; Oct 7th, 2009 at 1:15 pm.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 178
Reputation: Vineeth K is an unknown quantity at this point 
Solved Threads: 9
Vineeth K's Avatar
Vineeth K Vineeth K is offline Offline
Junior Poster
 
0
  #2
Oct 8th, 2009
I think you made mistake in declarations if any ..
Integers never load a decimal point.But a Double do.

Are you trying to open the notepad ??It is not clear .
Read from a notepad is equal to open it.Then you will get the whole data in notepad.
Who wants to be a GOD ??
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 916
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 167
vb5prgrmr vb5prgrmr is offline Offline
Posting Shark
 
0
  #3
Oct 8th, 2009
It may also depend upon your local settings on your computer. I don't know about brazil but some countries use the decimal/period character as a thousands seperator and since you have 30.5 and not 30.500 it may be stripping it.

So to perhaps solve this you may want to read the value into a string and then convert to a double.



Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: Domus BRASIL is an unknown quantity at this point 
Solved Threads: 0
Domus BRASIL Domus BRASIL is offline Offline
Newbie Poster
 
0
  #4
Oct 8th, 2009
I have several textbox to search a number that is in a line of a file in. txt

but if this number is decimal, it reads as if the number was over

what I do for a textbox recognize this number as a decimal?
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 916
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 167
vb5prgrmr vb5prgrmr is offline Offline
Posting Shark
 
0
  #5
Oct 8th, 2009
So, you first read the value in from a text file, right? So at that point you have "30.5". Then somewhere it gets changed, right?

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim SomeVariable As Double
  2. SomeVariable = CDbl("30.5")



Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,868
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 120
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso
 
0
  #6
Oct 9th, 2009
Yes correct all your variable declarations.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: dandanventura is an unknown quantity at this point 
Solved Threads: 0
dandanventura dandanventura is offline Offline
Newbie Poster
 
0
  #7
Oct 26th, 2009
oi...
pelo que entendi vc esta com problemas de declaracao de variaveis como os outros colegas disseram. O maior problema e se vc esta conseguindo pegar o numero 3.5 , se afirmativo tente jogar numa string, apos trocar o ponto por virgula e entao joga-lo para double.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 255
Reputation: AndreRet is an unknown quantity at this point 
Solved Threads: 38
AndreRet AndreRet is offline Offline
Posting Whiz in Training
 
0
  #8
Oct 26th, 2009
You can also try your textbox format -

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Text1.text = Format(Text1.text, "### ###.##")
  2. 'Where ## is the actual number entered into text box.

You can also try this sub I've done some while back

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function Txtnumdeci(Key As Integer, Strinfo As String) As Integer
  2. Dim Deciprs As Boolean
  3. Dim Ctr As Integer
  4. Dim Decipos As Integer
  5.  
  6. Decipos = InStr(Strinfo, ".")
  7. If Decipos Then
  8. Deciprs = True
  9. Else
  10. Deciprs = False
  11. End If
  12.  
  13. Select Case Key
  14. Case vbKey0 To vbKey9
  15. If Deciprs = True Then
  16. Ctr = Len(Mid(Strinfo, Decipos + 1, Len(Strinfo) - Decipos + 1))
  17. If Ctr = 2 Then
  18. Txtnumdeci = 0
  19. Else
  20. Txtnumdeci = Key
  21. End If
  22. Else
  23. Txtnumdeci = Key
  24. End If
  25. Case vbKeyBack
  26. Txtnumdeci = Key
  27. Case vbKeyDecimal, Asc(".")
  28. If Deciprs = True Then
  29. Txtnumdeci = 0
  30. Else
  31. Txtnumdeci = Key
  32. End If
  33. Case vbKeyReturn
  34. SendKeys "{TAB}"
  35. Case Else
  36. Txtnumdeci = 0
  37. End Select
  38. End Function

Hope this helps.
Please mark questions as answered when done.

Be the ONE!!!
Reply With Quote Quick reply to this message  
Reply

Tags
basic, microsoft, vb6, visual, web

Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 1058 | Replies: 7
Thread Tools Search this Thread



Tag cloud for basic, microsoft, vb6, visual, web
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC