Basics of Visual Basic.NET

Visual Basic .NET aka VB.NET is used in combination with ASP.NET to create interactive web pages. The "code-behind" of the web page resides on the web server and interacts with a web user via their browser. Although this page does not provide an in-depth education on VB.NET it serves as a brief overview, quick reference to VB.NET sytax and a place to quickly locate the code you need to accomplish a task.


Quick Notes:

The Me keyword is shorthand for the current form.
Overloads keyword means that the method has multiple syntax variations. It indicates that the method can be called with different arguments.
ByVal keyword describes how the argument is sent to the function

Error types:
Syntax Error: statement violates the rules of the language being used
Run-Time Error: a vailid statement is impossible to execute. Exceptions occur. (example: when the statement says to open a file that does not exist.
Logical Error: a design problem produces an incorrect result

Object Oriented Programming:

An Object can be considered as a "container" for a set of data and the operations that need to be performed on it. An object has the following properties:

  1. a Name that is unique
  2. it has DATA in the form of a set of characteristics or attributes, each of which has a value at any given point in time.
  3. There is a set of operations or METHODS that can be performed on the data
  4. It is an instance of a class.

Example: a car

The car has ATTRIBUTES:   (description)
make, model, number of doors, engine size, color.

The car has OBJECTS:   (parts)
like license plate, rearview mirror, seat, steering wheel, etc.

The car has METHODS:  (things it can do)
stop, turn, accelerate, brake (aka functions or procedures)

***Ford Motor Company would be the CLASS
***Mustang would be an INSTANCE of that class.

 

A CLASS defines the basic attributes and the methods available to objects of that class.

NOUNS:may translate into the OBJECTS in the program.

VERBS: may translate into the METHODS