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

Declaring Variables

The application example declares a variable in the first line of its Main method. Variables are places in which a method or program can store data during its lifetime. Thus, the following line determines that the variable input can take content of the type string:

Dim input As String

The String type restricts the input variable to character strings: in other words, any kind of text. The String keyword, therefore, represents a type that contains text. If you were to specify Integer as the type, the variable input could save numbers between approximately −2 billion and +2 billion, but only integers, no fractions. If you were to specify Double as the type, the input variable could also hold fractions. However, their range of value ...

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