45
MELJUN CORTES MELJUN CORTES MELJUN CORTES

MELJUN CORTES Visual Basic 2010 very good lecture

Embed Size (px)

DESCRIPTION

MELJUN CORTES Visual Basic 2010 very good lecture

Citation preview

Page 1: MELJUN CORTES Visual Basic 2010 very good lecture

MELJUN CORTESMELJUN CORTESMELJUN CORTES

Page 2: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicVisual Basic (VB) is a

third-generation event-driven programming language. It is also an integrated development environment (IDE) from Microsoft for its COM programming model.

MELJUN CORTES

Page 3: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicVisual Basic was derived

from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects.

MELJUN CORTES

Page 4: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicScripting

languages such as Visual Basic for Applications (VBA) and VBScript are syntactically similar to Visual Basic, but perform differently.

MELJUN CORTES

Page 5: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicIn 1988, Alan Cooper

created a visual programming language (code-named “Ruby”) that allowed Windows users to build “Finder”-like shells. He called it “a shell construction set.” After demonstrating Ruby to Bill Gates, Microsoft purchased it.

MELJUN CORTES

Page 6: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicVisual Basic, user

experience, interaction design, personas, Goal-Directed design, About Face, The Inmates Are Running The Asylum, VBX.

MELJUN CORTES

Page 7: MELJUN CORTES Visual Basic 2010 very good lecture

Visual BasicAt the time, Gates commented that the

innovation would have a “profound effect” on their entire product line. Microsoft decided not to release the product as a shell for users, but rather to transform it into a professional development tool by marrying it to their QuickBASIC programming language. They called the product Visual Basic.

MELJUN CORTES

Page 8: MELJUN CORTES Visual Basic 2010 very good lecture

MELJUN CORTES

Page 9: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic.NETVisual Basic .NET is an object-oriented

computer programming language that can be viewed as an evolution of the classic Visual Basic (VB) which is implemented on the .NET Framework.

MELJUN CORTES

Page 10: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic.NETVB.Net is also a Microsoft Common Language

Infrastructure language created by Microsoft.

Visual Basic .NET was designed, as part of the company's .NET product group, to make Web services applications easier to develop.

MELJUN CORTES

Page 11: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic.NETAccording to Microsoft, VB .NET was

reengineered, rather than released as VB 6.0 with added features, to facilitate making fundamental changes to the language.

MELJUN CORTES

Page 12: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic.NETVB.NET is the first fully object-oriented

programming (OOP) version of Visual Basic, and as such, supports OOP concepts such as abstraction, inheritance, polymorphism.

MELJUN CORTES

Page 13: MELJUN CORTES Visual Basic 2010 very good lecture

MELJUN CORTES

Page 14: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 1.0Visual Basic 1.0 was introduced in 1991. Visual Basic 1.0 (Windows) was released 1991

of May. Visual Basic 1.0 (DOS) was released in

September 1992. The interface used a Text user interface, using extended ASCII characters to simulate the appearance of a GUI.

MELJUN CORTES

Page 15: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 1.0

MELJUN CORTES

Page 16: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 2.0Visual Basic 2.0 was release in November

1992. The programming environment was easier to

user, and its speed was improved. Notably, forms became instant objects.

MELJUN CORTES

Page 17: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 3.0Visual Basic 3.0 was release in the summer of

1993 and came in Standard and Professional versions.

VB3 included version 1.1 of the Microsoft Jet Database Engine that could read and write Jet (or Access) 1.x databases.

MELJUN CORTES

Page 18: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 4.0Visual Basic 4.0 was released in August 1995. VB 4.0 was the first version that could create

32-bit as well as 16-bit Windows programs. It also introduced the ability to write non-GUI

classes in Visual Basic.

MELJUN CORTES

Page 19: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 5.0Visual Basic 5.0 (February 1997), Microsoft

released Visual Basic exclusively for 32-bit versions of Windows.

It also introduced the ability to create custom user controls, as well as the ability to compile to native Windows executable code, speeding up calculation-intensive code execution.

MELJUN CORTES

Page 20: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 5.0It was also used as an introductory form of

Visual Basic: a regular .exe project could be created and run in the IDE, but not compiled.

MELJUN CORTES

Page 21: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 6.0Visual Basic 6.0 (Mid 1998) improved in

number of areas including the ability to create web-based applications.

MELJUN CORTES

Page 22: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 6.0

MELJUN CORTES

Page 23: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 7Visual Basic 7 sometimes referred to as VB7

or Visual Basic.Net, was released in February 2002.

This product was conceived as a part of Microsoft.NET software initiative, designed to produce XML-based applications for the Microsoft Internet environment.

MELJUN CORTES

Page 24: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 7 (1.1)Visual Basic .NET 2003 was released with

version 1.1 of the .NET Framework. New features included support for the .NET Compact Framework and a better VB upgrade wizard. Improvements were also made to the performance and reliability of the .NET IDE (particularly the background compiler) and runtime.

MELJUN CORTES

Page 25: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 7 (1.1) In addition, Visual Basic .NET 2003 was

available in the Visual Studio.NET Academic Edition (VS03AE). VS03AE is distributed to a certain number of scholars from each country without cost.

MELJUN CORTES

Page 26: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 7.0

MELJUN CORTES

Page 27: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 8.0On November 2005, Microsoft released Visual

Studio 2005, which included Visual Basic 8 and the .Net Framework version 2.

Visual Basic 2005 is the name used to refer to the Visual Basic .NET, Microsoft having decided to drop the .NET portion of the title.

MELJUN CORTES

Page 28: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 8.0

MELJUN CORTES

Page 29: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 8.0For this release, Microsoft added many features,

including:Edit and ContinueThe My pseudo-namespace, which provides:

easy access to certain areas of the .NET Framework that otherwise require significant code to access

dynamically-generated classes (notably My.Forms)Improvements to the VB-to-VB.NET converterThe above functions (particularly My) are intended

to reinforce Visual Basic .NET's focus as a rapid application development platform and further differentiate it from C#.

MELJUN CORTES

Page 30: MELJUN CORTES Visual Basic 2010 very good lecture

Visual Basic 9.0Visual Basic 9.0 was released together with the

Microsoft .NET Framework 3.5 on 19 November 2007.

For this release, Microsoft added many features, including:A true conditional operator, "IIf(condition as boolean,

truepart, falsepart)", to replace the "IIf" function.Anonymous typesSupport for LINQLambda expressionsXML LiteralsType InferenceExtension methods

MELJUN CORTES

Page 31: MELJUN CORTES Visual Basic 2010 very good lecture

MELJUN CORTES

Page 32: MELJUN CORTES Visual Basic 2010 very good lecture

Changes in VB LanguageAll data are objects, based on the class:

System.Object. E.g. class supports Windows forms:

System.Windows.Forms.Form.The built-in VB functionality is

encapsulated in a namespace called System.E.g Collection has be replaced by

System.Collections.Old control are gone, and new ones have

appeared.MELJUN CORTES

Page 33: MELJUN CORTES Visual Basic 2010 very good lecture

Changes in VB LanguageMany keywords are renamed or gone,

while some new added.E.g. Gosub removed

Strict data typing is now enforcedVariable must be declared before used by

default.Cannot assign one data type to another, but

can use Ctype to convert between types. The same as in VC++ and C#.

Structured exception handling: Try…Catch…Finally.

MELJUN CORTES

Page 34: MELJUN CORTES Visual Basic 2010 very good lecture

Changes in VB LanguagesWhen calling procedures, must use

parentheses.Parameters are by default passed by value,

instead of by reference.Supports constructors and destructors for use

when initializing an object of a class.If…Then statements are now short-circuited.

MELJUN CORTES

Page 35: MELJUN CORTES Visual Basic 2010 very good lecture

Changes in VB LanguageA number of new compound operators

E.g. x+=2The And, Or, Not and Xor operators have

changed from bitwise to boolean operators. Meanwhile, the bitwise versions are BitAnd, BitOr, BitNot, and BitXor.

No default property supportedE.g. VB6: TextBox1=“Hello” VB.Net: TextBox1.Text=“Hello”

MELJUN CORTES

Page 36: MELJUN CORTES Visual Basic 2010 very good lecture

Changes in VB LanguageThree new data

typesChar: unsigned 16-

bitShort: signed 16-

bitDecimal: signed

96-bit (replaces Variant)

Integer Type VB 6.0 VB.NET

8 bit Byte Byte

16 bit Integer Short

32 bit Long Integer

64 bit Not Applicable Long

MELJUN CORTES

Page 37: MELJUN CORTES Visual Basic 2010 very good lecture

MELJUN CORTES

Page 38: MELJUN CORTES Visual Basic 2010 very good lecture

Comments'Single line onlyREM Single line only''' <summary>XML comments</summary>ex.

If messageBox = “Hello” ThenThis is a comment

End If

MELJUN CORTES

Page 39: MELJUN CORTES Visual Basic 2010 very good lecture

Class DeclarationPublic Class className

…End Classex.

Public Class Employee…

End Class

MELJUN CORTES

Page 40: MELJUN CORTES Visual Basic 2010 very good lecture

Declaration of VariableDim variableName As dataTypeex.

Dim messageContent As StringDim myNumber As Integer

MELJUN CORTES

Page 41: MELJUN CORTES Visual Basic 2010 very good lecture

Conditional StatementsIf condition Then

statementElse If condition2 Then

statement2Else

statement3End Ifex.

If messageContent = “Hello World” ThenMessageBox.Show(“Hello World”)

Else if messageContent = “Hello” ThenMessageBox.Show(“Hello”)

ElseMessageBox.Show(“Hello World Hello”)

End If

MELJUN CORTES

Page 42: MELJUN CORTES Visual Basic 2010 very good lecture

Looping StatementsDo While

Do While condition

statement

Loop

ex.

Do While myNumber > 20

MessageBox.Show(myNumber)

myNumber = myNumber + 1

Loop

MELJUN CORTES

Page 43: MELJUN CORTES Visual Basic 2010 very good lecture

Looping StatementsFor

For conditionStatement

Nextex.

For myNumber = 10 To 20

MessageBox.Show(myNumber)Next

MELJUN CORTES

Page 44: MELJUN CORTES Visual Basic 2010 very good lecture

Looping StatementsDo Until

Do Until condition

statement

Loop

ex.

Do Until myNumber = 20

MessageBox.Show(myNumber)

myNumber = myNumber + 1

Loop

MELJUN CORTES

Page 45: MELJUN CORTES Visual Basic 2010 very good lecture

Logical OperatorsAndAlso   OrElse   And   Or   Xor   Notex.

If myNumber = 10 And messageContent = “Hello World” Then

…End If

MELJUN CORTES