|
-
Sep 28th, 2009, 09:57 AM
#1
Thread Starter
New Member
Problems with Console.Read()
Hi,
I am stuck with this very basic problem that I am unable to resolve. Here is a piece of code that I am working on:
Module Module1
Sub Main()
Console.Write("Enter Age, Name Salary: ")
Age = Console.Read()
FirstName = Console.Read()
Salary = Console.ReadLine()
Console.WriteLine(Age & " " & FirstName & " " & Salary)
End Sub
End Module
At the command prompt I enter the following values
20 Ann 20000
and it gives me an InvalidCastException
Could you explain what kind of input would be suitable to make this run???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|