#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    8
    Rep Power
    0

    Coding using Functions


    I need some help writing a code for this question. I am using Visual Basics 2010 Express Edition

    Write the code for a function that prompts the user to enter the name of a state and then returns the userís response. Name the function GetState. Then write a statement to invoke the GetState function. Display the functionís return value in a message box.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Brindisi
    Posts
    4
    Rep Power
    0
    Maybe that I don't have really understood your question, and I'm not sure this works also in VB.Net 2010, but however try this code below:

    Code:
    Public|Private Function GetState() As String
      GetState = InputBox("Enter the Country you come from:")
    End Function
    
    'and the you call like this
    
    Call MsgBox(GetState())
    It's really easy, isn't it?

IMN logo majestic logo threadwatch logo seochat tools logo