22
Visual Basic Rick, Albert

Visual Basic Rick, Albert. 1. Visual Basic 1.0 (May 1991) was released for Windows at the Comdex/Windows World trade show in Atlanta, Georgia.1991 2

Embed Size (px)

Citation preview

Visual Basic

Rick, Albert

BACKGROUND

1. Visual Basic 1.0 (May 1991) was released for Windows at the Comdex/Windows World trade show in Atlanta, Georgia.

2. Visual Basic 1.0 for DOS was released in September 1992.it was actually the next version of Microsoft's DOS-based BASIC compilers

3. Visual Basic 2.0 was released in November 1992. easier to use, and its speed was improved

4. Visual Basic 3.0 was released in the summer of 1993 and came in Standard and Professional versions.

5. Visual Basic 4.0 (August 1995) was the first version that could create 32-bit as well as 16-bit Windows programs.

6. With version 5.0 (February 1997), Microsoft released Visual Basic exclusively for 32-bit versions of Windows.

7. Visual Basic 6.0 (Mid 1998) improved in a number of areas [8] including the ability to create web-based applications

About VB

Visual Basic (VB) is the third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. Visual Basic is relatively easy to learn and use.

Visual 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,

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.

VB environment

VB sample program

CommentsThe Main procedureInput and output

•Sub Main(ByVal cmdArgs() As String) •Function Main() As Integer •Function Main(ByVal cmdArgs() As String) As Integer •Sub Main()

Readability

Visual Basic is based on simplicity. Programmers use a few fundamental types of objects to build an application. -Good

VB requires user to prefix assignments on “objects” with Set. But if user try to put a Set in front of assignments on what VB considers primitives, user will get an error that reads “Object required: …….”. -Bad

VB consists of features and syntax borrowed from other languages -Bad

Writability

VB is easy to learn and write -Good It can be used as a front end to SQL (or other

databases) allowing the user to enhance the way they access their data. -Good

It can also be used to create ActiveX and COM components for use online or in desktop applications. -Good

VB is a "component integration language" which utilizes Microsoft's Component Object Model ("COM") that allows parts to be bolted onto programs easily. -Good

Reliability

It is not suited to complex modern programming techniques. -Bad

VB is an interpreted language which again slows the execution of your program down. -Bad

As you can control the checking and warning systems in VB it often enables the programmer to write code that is very difficult to troubleshoot when a bug arises. -Bad

The programs a programmer produces in VB are not portable and cannot be used on non-Windows systems. -Bad

Cost

Visual Basic can be purchased by itself. Visual Basic. Net is only sold as part of what Microsoft calls Visual Studio .NET. Visual Studio .NET also includes the other Microsoft supported .NET languages, C#.NET, J#.NET and C++.NET. Visual Studio comes in a variety of versions with different capabilities that go well beyond just the ability to write programs.

Fortunately, Microsoft also provides a completely free version of Visual Basic called Visual Basic .NET 2005 Express Edition (VBE).

In October 2006, Microsoft's posted list prices for Visual Studio .NET ranged from $800 to $2,800 although various discounts are often available.

Personal Programming

The term "Personal Programming" refers to the idea that, wherever you work, whatever you do, you can expand your computer's usefulness by writing applications to use in your own job.

Personal Programming is what Visual Basic is all about.

3-Step approach for creating programs

VB presents a 3-step approach for creating programs:

Design the appearance of your application.

Assign property settings to the objects of your program.

Write the code to direct specific tasks at runtime.

Areas Visual Basic is Used Visual Basic is used in a number of different areas,

for example: Education Research Medicine Business Commerce Marketing and Sales Accounting Consulting Law Science

Statements

(Else-If Statement)Ex:Dim count As Integer = 0Dim message As String

If count = 0 Then message = "There are no items."ElseIf count = 1 Then message = "There is 1 item."Else message = "There are " & count & " items."End If

Statements

(For...Next Statement)Ex:For index As Integer = 1 To 5 Debug.Write(index.ToString & " ")NextDebug.WriteLine("")' Output: 1 2 3 4 5 This statement repeats a group of

statements a 5 times.

Data Types

String VariableExamples:This code is used to declare a string variable.  Private Sub Form_Load() Dim City As StringEnd Sub This code is used to initialize a variable after it's been declared. If

you want its area of memory to be empty, you can assign it two double quotes.

 Private Sub Form_Load() Dim City As String City = ""End Sub

Data Types

Boolean Boolean variables are values that can be only either True of False. To

declare a Boolean variable, use the Boolean keyword. Private Sub Form_Load() Dim Married As BooleanEnd Sub You can initialize a Boolean variable by assigning it to either True or

False after you declared it.  Private Sub Form_Load() Dim Married As Boolean Married = FalseEnd Sub

LoopsA Do loop repeats a block of statements while a Boolean condition is true or

until the condition becomes true. 

Dim index As Integer = 0Do While index <= 10 Debug.Write(index.ToString & " ") index += 1LoopDebug.WriteLine("")' Output: 0 1 2 3 4 5 6 7 8 9 10  For Loop Ex:Private Sub Form_Load()For i = 1 To 10 Step 1Print "programmershelp"Next iEnd Sub

Program Examples

Private Sub Form_Activate ( ) Print 20 + 10Print 20 - 10Print 20 * 10Print 20 / 10 End SubOutput: 30102002

Private Sub

 

A = Tom

B = “likes"

C = “to"

D = “eat"

E = “burger"

Print A + B + C + D + E

 

End Sub

Private Sub

  A = Tom

B = “likes"

C = “to"

D = “eat"

E = “burger"

Print A & B & C & D & E

 

End Sub

Output: Tom likes to eat burgers

Who uses Visual Basic?

Microsoft  Vertex

Banamex/Citigroup

Bill Gates developed a version of BASIC for the first microcomputer- the MITS Altair

Mega Corporations

Facts

Visual Basic is most highly utilized in the world of business programming.

Visual Basic was formerly known as "Project Thunder."

Visual Basic is rarely case sensitive.

A 2003 report says that fifty two percent of software developers made use of Visual Basic.

Reference http://visualbasic.about.com/od/

applications/a/whatisvb_2.htm

http://groups.engin.umd.umich.edu/CIS/

course.des/cis400/vbasic/vbasic.html 

http://www.johnsmiley.com/visualbasic/

vbhistory.htm

http://www.go4expert.com/forums/

showthread.php?t=3625

http://msdn.microsoft.com/en-us/library/

752y8abs.aspx

http://msdn.microsoft.com/en-us/library/

5z06z1kb.aspx

http://cuinl.tripod.com/tutorials/f-11.htm

http://www.programmershelp.co.uk/

vbforloops.php

http://www.thocp.net/biographies/

gates_bill.htm

http://www.instabriefs.com/computer-

programming/visual-basic/visual-basic-fast-

facts.php