Changes

Jump to: navigation, search

Understanding Visual Basic Variable and Constant Types

692 bytes added, 18:38, 11 July 2007
Object Variable
The ''Object'' variable is a catch-all variable type which can be used to store a value of any data type. Because of this flexibility, an ''Object'' variable will typically reserve more memory than is needed for most variable types. For this reason, it is more efficient to use the correct variable type for the value you need to store (such as ''Char'' for a character or ''Integer'' for a whole number) rather than use the Object variable type.
 
== Long Variable ==
 
The Visual Basic ''Long'' variable type is used to store whole numbers ranging from -9,233,372,036,854,775,808 to 9,233,372,036,854,775,807.
 
== Short Variable ==
 
A ''Short'' variable in Visual Basic stores a whole number in the range -32,768 to 32,767.
 
== String Variable ==
 
The ''String'' variable type stores multiple characters that make up words or sentences. ''String'' variables are encapsulated in double-quotation marks ("). For example "Hello" is a string, as is "Hello, this is a test".
 
Visual Basic provides a number of mechanisms for working with and manipulating strings as covered in the [[Working with Strings in Visual Basic]] chapter of this book.

Navigation menu