Console.Readline help

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 14
Reputation: Dnx is an unknown quantity at this point 
Solved Threads: 2
Dnx Dnx is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #11
Sep 12th, 2008
i just create a console project and put your code and it works...
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: 3Dees is an unknown quantity at this point 
Solved Threads: 0
3Dees 3Dees is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #12
Sep 12th, 2008
Ok Dnx,
So did that, but how do i check if its "." or "," i could only deplay the value in the program at run time.

3dees
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: 3Dees is an unknown quantity at this point 
Solved Threads: 0
3Dees 3Dees is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #13
Sep 12th, 2008
it worked???
Did you convert it to double as well?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 14
Reputation: Dnx is an unknown quantity at this point 
Solved Threads: 2
Dnx Dnx is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #14
Sep 12th, 2008
yes, i didn't change anything in your code

maybe check what you enter... and regional settings?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: 3Dees is an unknown quantity at this point 
Solved Threads: 0
3Dees 3Dees is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #15
Sep 12th, 2008
ok Dnx
Tried it again and it worked, will have to check to understand why it didn't worked before.

Dim Liters As String = Console.ReadLine()
quantity = Convert.ToDouble(Liters)

Thanks very much Dnx.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 14
Reputation: Dnx is an unknown quantity at this point 
Solved Threads: 2
Dnx Dnx is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #16
Sep 12th, 2008
No problem, glad i could help even if your code was good since the beginning

Regards.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: 3Dees is an unknown quantity at this point 
Solved Threads: 0
3Dees 3Dees is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #17
Sep 12th, 2008
Hey sometimes it just takes a 2nd pair of eyezzzzzz + just this week load VB2008 so now sure if i have all the ms updates.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: silambharasan is an unknown quantity at this point 
Solved Threads: 0
silambharasan silambharasan is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #18
Sep 14th, 2008
hay,
the below method is the method to use type casting and it will execute
u check it (if u want to cast as value use below or else use type cast(source,typename))
Dim a, quantity As Double
Console.Write("How many liters(only whole liters please )? ")
a = Console.ReadLine()
quantity = CType(a, Double)
Console.WriteLine(quantity)
reply pls.,,
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 7
Reputation: EDDYGATE is an unknown quantity at this point 
Solved Threads: 0
EDDYGATE EDDYGATE is offline Offline
Newbie Poster

Re: Console.Readline help

 
0
  #19
Sep 15th, 2008
I know of the "Convert "class in vb and i think you can try this
  1. dim quantity as double
  2. quantity=convert.toDouble(Console.Readline)
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 2939 | Replies: 18
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC