[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need changes to console application example in VB.NET !!

Posted on 2006-10-30
4
Medium Priority
?
196 Views
Last Modified: 2010-04-23
CAN YOU MODIFY THE BELOW PROGRAM AND MAKE IT WORK ?
========================================


Module Module1

    Sub Main()
       
        'Reading values
         
        Console.WriteLine("Please input the following info !")
        Console.WriteLine()  

        Console.WriteLine("Enter your name : ")
        Dim x As String = Console.Read()              //WRONG
        Console.WriteLine("Enter your age : ")
        Dim y As Integer = Console.Read()           //WRONG
        Console.WriteLine("Enter your dob : ")
        Dim z As DateTime = Console.Read()       //WRONG
        Console.WriteLine("Enter your gender (M/F) : ")
        Dim a As ----------------------------           //Need this line of code

        Console.ReadLine()

        'Writing values
         
        Console.WriteLine("You have input the following info !")
        Console.WriteLine()  
     
        Console.WriteLine("Your name : " & x)
        Console.WriteLine("Your age : " & y)
        Console.WriteLine("Your dob : " & z)
        Console.WriteLine("Your gender (M/F) : & a)

        Console.ReadLine()

    End Sub

End Module
0
Comment
Question by:kishore_peddi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 2000 total points
ID: 17838265
If Console.WriteLine() writes a line of text, what would read a line of text?
0
 

Author Comment

by:kishore_peddi
ID: 17838337
Can you please tell me how to declare a single character (Y/N) in VB.NET ?

0
 

Author Comment

by:kishore_peddi
ID: 17838403

Here is the code
==========

Module Module1

    Sub Main()

        'Reading values

        Console.WriteLine("Please input the following info !")
        Console.WriteLine()

        Console.Write("Enter your name : ")
        Dim x As String = CStr(Console.ReadLine())
        Console.Write("Enter your age : ")
        Dim y As Integer = CInt(Console.ReadLine())
        Console.Write("Enter your dob : ")
        Dim z As DateTime = CDate(Console.ReadLine())
        Console.Write("Enter your gender (M/F) : ")
        Dim a As Char = Console.ReadLine()

        'Need gap

        Console.WriteLine()

        'Writing values

        Console.WriteLine("You have input the following info !")
        Console.WriteLine()

        Console.WriteLine("Your name : " & x)
        Console.WriteLine("Your age : " & y)
        Console.WriteLine("Your dob : " & z)
        Console.WriteLine("Your gender (M/F) : " & a)

        Console.ReadLine()

    End Sub

End Module

How we can restrict the user input for name (let us say 10 characters) while he is typing at console window ? Appreciate your time and patience !!
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17838407
I Googled "VB .NET datatypes" and found a number of pages that list types available in VB .NET.  

For that matter, what would you guess a type that stores a single character might be called?  Languages have some funky keywords, but most aren't THAT bad.  (-:
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question