This appendix provides a glossary of key terms that you may encounter while studying Visual Basic programs.
Underlined character, usually in a menu item, that activates that menu item when the user presses [Alt] plus the letter.
Form property that determines the button triggered when the user presses [Enter].
Determines which code is allowed to access subroutines, fields, properties, methods, and other class members. This can be Public, Private, Protected, Friend
, or Protected Friend
.
The Get
and Set
methods that allow a class to save and return a property's value.
Property that enables a control to attach its left, right, top, and bottom edges to those of its container.
A data type that is automatically created by LINQ and never given a name for your code to use.
Application Programming Interface. A library of methods, classes, and other programming tools.
A group of values stored together in a single variable and accessed by index.
The smallest independent unit of compiled code. Typically, this is a Dynamic Link Library (DLL) or executable program.
A statement that the code claims is true. If the statement is false, the program stops running so you can decide whether a bug occurred.
A private field used to store the value of a property. The property's accessors get and set the backing field's value.
A single binary digit. A bit can hold the value 0 or 1.
A marked piece of code that stops execution when running in the IDE.
A programming error that makes a program fail to produce the correct result. A bug may make the program crash, produce an incorrect result, or perform the wrong action.
When you pass a parameter to a procedure by reference, Visual Basic passes the location of the value's memory into the procedure. If the procedure modifies the parameter, the value is changed in the calling code as well. Use the ByRef
keyword to pass a value by reference.
When you pass a parameter by value, Visual Basic makes a copy of the value and passes the copy to the procedure. Changes that the procedure makes to the value do not affect the value in the calling code. Use the ByVal
keyword to pass a value by value.
Eight bits. When considered as an unsigned integer, a byte can hold values between 0 and 255. When considered as a signed integer, a byte can hold values between −127 and 128.
See computer aided design.
A naming convention whereby multiple words are strung together with the first letter of each word except the first capitalized, as in firstName
or numberOfEmployees
.
Form property that determines the button triggered when the user presses [Esc].
When an exception occurs, a program can catch the exception to take control and perform some remedial action (or just tell the user that something's wrong). When an object raises an event, the program can catch the event and take action.
Defines a data type with properties, methods, events, and other code encapsulated in a package. After you define a class, you can make as many instances of that class as you like. Very similar to a structure except classes are reference types, whereas structures are value types.
A code file that is not associated with any form or other class.
Text within the program that is not executed by the program. Use comments to make the code easier to understand.
A programming entity similar to a control except it has only code and doesn't have a visible appearance on the screen. You still place it on a form at design time, however, and the program's code can interact with it. Some components such as ErrorProvider
and ToolTip
may display visible effects on the screen.
The area below the form where components sit at design time.
Operators such as +=
and &=
that combine a variable's current value with a new value.
A program that helps the user design something, often something graphical such as an architectural drawing or an electronic circuit. Many CAD systems do more than just draw. For example, they may produce lists of materials, validate electronic circuits, or calculate physical properties of the system designed.
To join two strings together.
The AndAlso
and OrElse
operators, which evaluate their second operands only if necessary.
Similar to a variable, but you must assign it a value when you declare it and you cannot change the value later. You can use constants to make your code easier to read.
A method that executes when an object is created.
A programming entity that combines a visible appearance on the screen with code that defines its appearance and behavior.
Basically, Greenwich Mean Time (GMT), the time at the Royal Observatory in Greenwich, London. (See en.wikipedia.org/wiki/Coordinated_Universal_Time for details and history.)
A particular kind of data such as Integer, String, Date
, or TextBox
. All variables must have a data type.
The parameterless constructor that is created by default when you create a class.
When a program delays performing some task until a later time. LINQ uses deferred execution when it delays performing a query until the results of the query are actually needed.
The stage of development when you are editing a program in Visual Studio. During this time, you use the Form Designer, Code Editor, Properties window, and other IDE features to build the program. Contrast this with run time.
The result returned by a dialog to tell the calling code which button was clicked. Also a Button
property that determines the DialogResult
the button sets for the form.
Property that enables a control to fill the left, right, top, bottom, or remaining area of its container.
When you select a group of controls in the Form Designer, one is marked as the dominant control. Arranging tools use this control to determine how the controls are displayed. For example, the Format
An object that is a candidate to receive data dropped in a drag-and-drop operation.
A debugger feature that enables you to modify a stopped program's code and continue running without stopping and restarting the program.
Detail hiding. A class hides its internal details so the rest of the program doesn't need to understand how they work, just how to use them.
See enumeration.
A data type that can take one of a list of specific values.
Also called the Euclidean algorithm. An efficient algorithm for finding the greatest common divisor (GCD) of two numbers.
An object raises an event to tell the program that something interesting has occurred. The program can catch the event to take action.
An event handler catches an event and takes appropriate action.
Object that represents some kind of error such as an attempt to divide by zero or an attempt to parse a string that has an invalid format.
The factorial of a number N is written N! and equals 1 * 2 * 3 * ... * N.
The Nth Fibonacci number Fib(N) is defined recursively by Fib(0) = 0, Fib(1) = 1, and Fib(N) = Fib(N – 1) + Fib(N – 2).
A variable defined in a class or structure that's not inside any method so it is visible throughout the class or structure.
A packaged set of code that other pieces of code can invoke and that returns a result value. See procedure.
Graphics Device Interface. A library of methods for rendering graphics in Windows used by Windows Forms controls.
The .NET version of GDI.
A class that takes as a parameter one or more data types that it uses to work more closely with those data types. See Lesson 30 for information about generic classes.
A constraint on the types passed to a generic class, such as requiring the type to have a parameterless constructor or requiring that it implement the IComparable
interface.
The process of building an application for users from different cultures.
The largest integer that evenly divides two other integers.
See integrated development environment.
A value that selects an item from a group. For example, in an array, the index is an integer between 0 and one less than the number of elements in the array used to identify a specific item in the array.
An instance of a class is an object of the class's type. Different instances of the same class have the same properties, methods, and events but they may have different property values.
An environment for building, testing, and debugging programs, such as Visual Studio.
Defines public properties, methods, and events that a class must provide to satisfy the interface.
Language Integrated Query. A set of extensions provided by the .NET Framework that allows Visual Basic code to query and select data from data sources such as arrays and lists.
A setting that defines the user's language, country, and cultural settings, which determine such things as how dates and monetary values are formatted and parsed.
The process of customizing a globalized application for a specific culture.
A low-level language that gives instructions directly to the computer's central processing unit to perform tasks on the machine's hardware. Machine language is much harder for humans to read and understand than a higher-level programming language such as Visual Basic.
A value hard-coded into a program that is difficult to remember. To make code clearer, use constants such as taxRate
instead of magic numbers such as 0.09D
.
1,024 kilobytes.
A procedure implemented by a class. See procedure.
A variable that is declared inside a method and not inside any other code block has method scope. It is visible to all of the following code within that method.
When a program displays a modal form, the user cannot interact with any other part of the application until closing that form. Dialogs are generally modal. A form's ShowDialog
method displays the form modally.
When a program displays a modeless form, the user can interact with other parts of the application while the modeless form is still visible. A form's Show
method displays a modeless form.
A special object reference that means "the object that is currently executing this code."
A namespace containing properties and methods shortcuts that make it easier to access commonly needed tools.
A classification of classes with a common purpose. Use Imports
directives at the top of a code file to tell Visual Basic which namespaces to search for classes that the code uses.
A conversion from a "wide" data type such as Single
to a "narrower" data type such as Integer
. Some precision may be lost in a narrowing conversion.
Half a byte (4 bits).
Passed as a second parameter to Decimal.Parse
, this allows that method to correctly interpret values formatted as currency.
A tool that maps between pieces of data in a relational database and objects in a program.
Defining a new meaning for an operator such as +
or *
when working with arguments of specific data types.
See object-relational mapper.
Giving a class more than one method with the same name but different parameter lists.
To try to find structure and meaning in text.
A naming convention whereby multiple words are strung together with the first letter of each word capitalized, as in TextBox
and ProgressBar
.
A single point on the screen or in an image. The word pixel comes from "picture element."
The ability to treat an object as if it were an instance of an ancestor class. For example, if Employee
inherits from Person
, then a method that takes a Person
as a parameter can also take an Employee
as a parameter.
The order in which operators are applied in an equation.
Part of a formatting string passed to String.Format
that affects the way a formatting character works. For example, the 10 in the format D10 formats an integer value with digits only (no thousands separators), padded on the left with zeros if necessary so it is 10 digits long.
A packaged set of code that other pieces of code can invoke. Types of procedures include subroutines, functions, methods, and property procedures.
A language used by developers to build programs. Contrast this with machine language, which is at a much lower level intended for use by the computer.
A LINQ query that uses a select clause to return data other than the values over which the query ranges.
A Get
or Set
procedure used to implement a property for a class. See procedure.
A list that lets you add items at the front and remove them from the back. Also called a FIFO list or FIFO. (FIFO stands for first-in-first-out.)
An object raises an event to tell the program that something interesting occurred.
The variable that a LINQ query uses to range over the data in the data source.
Restructuring a program to make it more reliable, easier to read, or easier to maintain without changing its outward behavior.
A data type such as a class reference that refers to an item instead of holding the item itself. Variables referring to class instances are reference variables. Contrast this with a value type.
Two numbers are relatively prime if their greatest common divisor is 1.
The time when the program is running. Contrast this with design time.
A variable's scope is the code that can "see" or access the variable.
A clause in a LINQ query that determines what data is returned for the selected data.
A method that is provided by the class itself, rather than an instance of the class. You invoke it as in ClassName.MethodName()
.
Key combination such as [Ctrl]+S or [Ctrl]+N that immediately activates a menu command.
Consequences that last after a method has finished. Side effects make code harder to understand and debug, so you should try to avoid writing methods with non-obvious side effects.
An area that you can click and drag to adjust the sizes of the areas on either side of the splitter.
A list that lets you add items at the top and remove them from the bottom. Also called a LIFO list or LIFO. (LIFO stands for last-in-first-out.)
Requiring values to have specific data types such as Person
or String
instead of more general types such as Object
.
Defines a data type with properties, methods, events, and other code encapsulated in a package. After you define a structure, you can make as many instances of that structure as you like. Very similar to a class except classes are reference types, whereas structures are value types.
See subroutine.
A packaged set of code that other pieces of code can invoke that does not return a value. See procedure.
1,024 gigabytes.
A program throws an exception to indicate that something bad has happened that it cannot handle. Other code higher up in the call stack can catch the exception and take action.
An array's largest index. Because Visual Basic arrays start with lower bound 0, the upper bound (for one-dimensional arrays) is one less than the array's length.
A data type that holds its data, not a reference to it. Primitive data types such as Integer
and Single
, as well as structures, are value types. Contrast this with a reference type.
A named piece of memory that can hold a piece of data.
A general-purpose, high-level programming language. It is one of the programming languages that can run in the powerful Visual Studio integrated development environment (IDE).
A development environment for building programs in several programming languages, including Visual C#, Visual Basic, Visual C++, and F#. Home page: msdn.microsoft.com/vstudio
.
A clause in a LINQ query that filters the data to return only selected items.
A conversion from a "thin" data type such as Integer
to a "wider" data type such as Single
. No precision is lost in a widening conversion