Value Property

keep getting the following errors when I try to run my Introduce Yourself program.

Var fullName As String
Var currentAge As Integer
Var today As DateTime = DateTime.Now
Var theMessage As String

  • fullName = FirstName.Value + " " + LastNameField (FIRST ERROR)
  • currentAge = Today.Year = BirthYearField.Value.ToInteger (2nd ERROR)
    theMessage = "Your name is " + fullName + EndOfLine
    theMessage = theMessage + "and you will be "
    theMessage = theMessage + currentAge.ToString
    theMessage = theMessage + " at the end of the year "
    theMessage = theMessage + today.Year.ToString + “.”
    MessageBox(theMessage)

I think my window 1 user setup is incorrect as I could not find any way to set the label program’s Value property.

Any help would be greatly appreciated,

Bob

If LastNameField is a TextField then you’ll need to use LastNameField.Value

so

fullName = FirstNameField.Value + " " + LastNameField.Value

and

currentAge = Today.Year = BirthYearField.Value.ToInteger

the 2nd equals = here … ^ should be a minus -

If in doubt, cut and paste from the programming pdf :slight_smile:

http://files.xojo.com/Documentation/IntroductionToProgramming/IntroductionToProgrammingWithXojo-PDF.zip

If you download and expand that zip, there’s a copy of the project in the XojoProjects folder that you can open and compare your version with, let us know if you have any more Q’s :slight_smile: Have fun! :slight_smile: