O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Expressions and Definitions of Variables

For numeric as well as date calculations or string operations, it is important to have an understanding of expressions. The following line (see Figure 1-6) is a String expression. The ReadLine method returns a string (in this case, whatever text the user has entered via the keyboard) and assigns the result to the variable input.

input = Console.ReadLine()

Another example of an expression in the code in Figure 1-6 is the static Parse method of the Date data type, as shown here:

birthyear = Date.Parse(input)

By assigning this expression in this manner, the string, which represents the date, is converted into a true date type. Remember, it’s important to use the correct type in the correct place. A computer doesn’t ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required