SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
MICROSOFT
VISUAL BASIC
A Brief History of Basic
· Language developed in early 1960's at
Dartmouth College:
B (eginner's)
A (All-Purpose)
S (Symbolic)
I (Instruction)
C (Code)
· Answer to complicated programming
languages (FORTRAN, Algol, Cobol ...).
First timeshare language.
A Brief History of Basic
. In the mid-1970's, two college students
write first Basic for a microcomputer
(Altair) - cost $350 on cassette tape.
You may have heard of them:
Bill Gates and Paul Allen!
· Every Basic since then essentially based
on that early version. Examples include:
GW-Basic, QBasic, QuickBasic.
· Visual Basic was introduced in 1991.
Visual Basic versions
Visual Basic 6.0 versus Other Versions of Visual
Basic
· The original Visual Basic for DOS and Visual Basic
For Windows were
introduced in 1991.
· Visual Basic 3.0 (a vast improvement over previous
versions) was released in
1993.
· Visual Basic 4.0 released in late 1995 (added 32 bit
application support).
·
·
Visual Basic versions
Visual Basic 5.0 released in late 1996. New
environment, supported creation of
ActiveX controls, deleted 16 bit application support.
· And, now Visual Basic 6.0 - some identified new
features of Visual Basic 6.0:
Þ Faster compiler
Þ New ActiveX data control object
Þ Allows database integration with wide variety of
applications
Þ New data report designer
Þ New Package & Deployment Wizard
Þ Additional internet capabilities
What is Visual Basic ?
• A high level programming language
• Created by Microsoft
• Uses a graphic environment called
Integrated Development Environment
(IDE)
• Capable of developing Windows-based
applications and games
• Event –driven language
• Made up of many subprograms , each
with its own codes that can run
independently, and at the same time
can be linked together
DEFINITION OF TERMS
1. Application - collection of objects that
works together to accomplish a certain task/s
for its users
Examples: MS Word, Adobe Photoshop, Corel
Draw
2. Project - the term used in Visual Basic
pertaining to Application
Examples: Payroll System, Quiz Bee Scoring
Program
DEFINITION OF TERMS
3. Object – a piece of software
that has properties and functions
that can be managed or
controlled
Examples: window, dialog box
DEFINITION OF TERMS
4. Property – characteristic of an object
Examples: color, size, background
5. Method – functions of an object that can
be manipulated
Examples: opening, resizing, moving (of a
window)
DEFINITION OF TERMS
6.Object-Oriented Environment – a place
wherein application is created using objects
and combining them to produce an output
7. Event – an action that happens
Examples: clicking of a button, clicking of
a menu, loading of form
DEFINITION OF TERMS
8. Event- Driven – an operation is executed
as the result of some kind of event
9. Form – the first object you will see on
the screen when you open Visual
Basic
- it is where all the controls are placed
- it is also where you will enter data and
see the results
10. Controls –the object you put on a form
Examples: text box, label, command
DEFINITION OF TERMS
11. Code -computer instructions written by the
programmer
indicates what the action or result will be when an
event occurs
Examples: getting the total of 2 numbers once
the button is clicked pop-up message appear
12.Script – other name for code
13. Design time - time when you visually design and
layout the forms and object in it
14. Run Time - time when the program is executed
Why is operation event –driven?
The Main Window consists of the
title bar, menu bar, and toolbar.
Title bar indicates the project name,
the current Visual Basic operating
mode, and the current form.
Menu bar has drop-down menus from
which you control the operation of the
Visual Basic environment.
 Toolbar has buttons that provide
shortcuts to some of the menu
options.
 The Main window also shows the
location of the current form relative to
the upper left corner of the screen
(measured in twips) and the width
and length of the current form.
The Form Window is central to developing
Visual Basic applications.
It is where you draw your application.
The Toolbox is the selection menu for controls
used in your application.
The Properties Window is used
to establish initial property
values for
objects. The drop-down box at the top
of the window lists all objects in the
current form.
Two views are available: Alphabetic
and Categorized. Under this box
are the available properties for the
currently selected object.
The Form Layout Window shows where (upon
program execution) your form will be displayed
relative to your monitor’s screen:
The Project Window displays a list of
all forms and modules making up
your application. You can also obtain a view
of the Form or Code windows (window
containing the actual Basic coding) from the
Project window.
Project Window
Take note:
Properties Window
Alignment = how text aligns in the control
Back Color = choose the color of the
background
Caption = the text that will appear in the
control
Font = choose the font type and size
Fore Color = choose the color of the text
(foreground)
Remember: Save the project as often as
it should be.
To switch between the Code window and the Form
window, use the buttons just over the Project Explorer
window (diagram on the left).
Tips on Improving your
application
-write the simplest program that you understand and make it
work - even if it doesn't have color or fancy fonts, test it and then
save it;
-make a copy of your previous working program and code one or
two improvements in the copy
- repeat for every improvement you make, using small steps so
that if something does go wrong its easier to identify the source
of the problem
Avoid repeating code!
The way to correct the application is to take all
the code that repeats and put it into a separate
procedure.
A procedure is identified by the Private Sub ...
End Sub lines.
Call the procedure simply by writing its name.
Writing code
Code Editor
Cut, Copy, Paste, Find, Replace
GOOD HABITS:
1.Use comments
2.Use indents
3.Use standard capitalization
4.Write extra-long statements on 2
lines using the continuation
character _ (space underscore)
VARIABLES
AND
CONSTANT
S
Variables and Constants
VARIABLE
 are used by Visual Basic to hold information
needed by your application
 sign or a name that stands for a particular
value in a program
 may store a data while the program is running
These are the rules to follow when naming
elements in VB - variables, constants, controls,
procedures, and so on:
A name must begin with a letter.
May be as much as 255 characters
Naming Conventions
Naming Conventions
 Must not contain a space or an embedded
period or type-declaration characters used to
specify a data type ; these are ! # % $ & @
 Must not be a reserved word (that is part of the
code, like Option, for example).
 The dash, although legal, should be avoided
because it may be confused with the minus sign.
Instead of Family-name use Familyname or
FamilyName.
Declaring Variables
Explicit Declaration – variable is declared at the
beginning of the procedure in the Declaration
Section
Dim Num_1 as Integer
Dim Age as String
Dim Reg_DOB as Date
Implicit Variables – variables is not formally
declared
- it is a result from other variable
declarations
Dim Total1 As Integer 'Explicit declaration
Dim Total2 As Integer 'Explicit declaration
Total3 = Total1 + Total2 'Implicit declaration
The term Scope refers to whether the
variable is available outside the procedure
in which it appears. The scope is
procedure-level or module-level.
A variable declared with Dim at the
beginning of a procedure is only available
in that procedure.
Scope of Variables
Public Statement
- variable can be used in several forms of the
project
Private Statement
- variable can only be used in the form it is
declared
 Module-level – variables declared in the
declarations section of the module
- available only for the control in the form
 Procedure-level - variables is declared
inside a procedure is called
- the original value will go back to its default
value once it is called
Constant
– stores a value that does not change the
value during the execution of the
procedure
Types of Constants
Intrinsic Constants – defined by Visual Basic
vbTrue
vbBlack
User-Defined Constants – defined by
programmers that write the code
Const Pi = 3.1416
Const Max_Num = 100
Object Browser - displays all the intrinsic
constants that are related to the properties of
the controls being created, including the
procedures and modules define for the object
Operators
Mathematical and Text operators
Operator Definition Example Result
^ Exponent (power of) 4 ^ 2 16
* Multiply 5 * 4 20
/ Divide 20 / 4 5
+ Add 3 + 4 7
- Subtract 7 – 3 4
Mod Remainder of division 20 Mod 6 2
 Integer division 20  6 3
& String concatenation "Joan" & " " & "Smith" "Joan Smith"
Note that the order of operators is determined by the usual rules in programming.
When a statement includes multiple operations the order of operations is:
Parentheses ( ), ^, *, /, , Mod, +, -
Logical operators
Operator Definition Example Result
= Equal to 9 = 11 False
> Greater than 11 > 9 True
< Less than 11 < 9 False
>= Greater or equal 15 >= 15 True
<= Less or equal 9 <= 15 True
<> Not equal 9 <> 9 False
AND Logical AND (9 = 9) AND (7 = 6) False
OR Logical OR (9 = 9) OR (7 = 6) True
Select Case
Can be used as an alternative to the If...Then...Else structure, especially
when many comparisons are involved.
Select Case ShirtSize
Case 1
SizeName.Caption = "Small"
Case 2
SizeName.Caption = "Medium"
Case 3
SizeName.Caption = "Large"
Case 4
SizeName.Caption = "Extra Large"
Case Else
SizeName.Caption = "Unknown size"
End Select
Do...Loop
Used to execute a block of statements an unspecified number of times.
Do While condition
statements
Loop
First, the condition is tested; if condition is True, then the statements are
executed. When it gets to the Loop it goes back to the Do and tests
condition again. If condition is False on the first pass, the statements are
never executed.
For...Next
When the number of iterations of the loop is known, it is better to
use the For...Next rather than the Do...Loop.
For counter = start To end
statements
Next
1) The counter is set to the value of start.
2) Counter is checked to see if it is greater than end; if yes, control
passes to the statement after the Next; if not the statements are
executed.
3)At Next, counter is incremented and goes back to step 2).
THANK YOU..

Weitere ähnliche Inhalte

Was ist angesagt?

visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introductionbloodyedge03
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netJaya Kumari
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statementEyelean xilef
 
Control structure C++
Control structure C++Control structure C++
Control structure C++Anil Kumar
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog controlSoumya Vijoy
 
Visual basic
Visual basicVisual basic
Visual basicDharmik
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE IntroductionAhllen Javier
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programmingChaffey College
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.netMUKALU STEVEN
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingAbha Damani
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training Moutasm Tamimi
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programmingNeeru Mittal
 

Was ist angesagt? (20)

visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog control
 
Visual basic
Visual basicVisual basic
Visual basic
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programming
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 

Andere mochten auch

Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
Ibm tivoli storage manager in a clustered environment sg246679
Ibm tivoli storage manager in a clustered environment sg246679Ibm tivoli storage manager in a clustered environment sg246679
Ibm tivoli storage manager in a clustered environment sg246679Banking at Ho Chi Minh city
 
Overview of v cloud case studies
Overview of v cloud case studiesOverview of v cloud case studies
Overview of v cloud case studiessolarisyougood
 
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762Banking at Ho Chi Minh city
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overviewsagaroceanic11
 
Ibm tivoli storage manager bare machine recovery for aix with sysback - red...
Ibm tivoli storage manager   bare machine recovery for aix with sysback - red...Ibm tivoli storage manager   bare machine recovery for aix with sysback - red...
Ibm tivoli storage manager bare machine recovery for aix with sysback - red...Banking at Ho Chi Minh city
 
Sparc t4 systems customer presentation
Sparc t4 systems customer presentationSparc t4 systems customer presentation
Sparc t4 systems customer presentationsolarisyougood
 
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...brettallison
 
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...VibrantGroup
 
Presentation oracle on power power advantages and license optimization
Presentation   oracle on power power advantages and license optimizationPresentation   oracle on power power advantages and license optimization
Presentation oracle on power power advantages and license optimizationsolarisyougood
 
RHT Upgrading to vSphere 5
RHT Upgrading to vSphere 5RHT Upgrading to vSphere 5
RHT Upgrading to vSphere 5virtualsouthwest
 
2.ibm flex system manager overview
2.ibm flex system manager overview2.ibm flex system manager overview
2.ibm flex system manager overviewsolarisyougood
 

Andere mochten auch (19)

History of Visual Basic Programming
History of Visual Basic ProgrammingHistory of Visual Basic Programming
History of Visual Basic Programming
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
INTRO TO VISUAL BASIC
INTRO TO VISUAL BASICINTRO TO VISUAL BASIC
INTRO TO VISUAL BASIC
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
Accelerate Return on Data
Accelerate Return on DataAccelerate Return on Data
Accelerate Return on Data
 
AIX 5L Differences Guide Version 5.3 Edition
AIX 5L Differences Guide Version 5.3 EditionAIX 5L Differences Guide Version 5.3 Edition
AIX 5L Differences Guide Version 5.3 Edition
 
Ibm tivoli storage manager in a clustered environment sg246679
Ibm tivoli storage manager in a clustered environment sg246679Ibm tivoli storage manager in a clustered environment sg246679
Ibm tivoli storage manager in a clustered environment sg246679
 
IBMRedbook
IBMRedbookIBMRedbook
IBMRedbook
 
Overview of v cloud case studies
Overview of v cloud case studiesOverview of v cloud case studies
Overview of v cloud case studies
 
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762
Proof of concept guide for ibm tivoli storage manager version 5.3 sg246762
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overview
 
Ibm tivoli storage manager bare machine recovery for aix with sysback - red...
Ibm tivoli storage manager   bare machine recovery for aix with sysback - red...Ibm tivoli storage manager   bare machine recovery for aix with sysback - red...
Ibm tivoli storage manager bare machine recovery for aix with sysback - red...
 
Sparc t4 systems customer presentation
Sparc t4 systems customer presentationSparc t4 systems customer presentation
Sparc t4 systems customer presentation
 
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
 
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...
Aix admin course provider Navi Mumbai | AIX Admin Course Training Navi Mumbai...
 
Presentation oracle on power power advantages and license optimization
Presentation   oracle on power power advantages and license optimizationPresentation   oracle on power power advantages and license optimization
Presentation oracle on power power advantages and license optimization
 
RHT Upgrading to vSphere 5
RHT Upgrading to vSphere 5RHT Upgrading to vSphere 5
RHT Upgrading to vSphere 5
 
2.ibm flex system manager overview
2.ibm flex system manager overview2.ibm flex system manager overview
2.ibm flex system manager overview
 
RHT Design for Security
RHT Design for SecurityRHT Design for Security
RHT Design for Security
 

Ähnlich wie VISUAL BASIC FUNDAMENTALS

Ähnlich wie VISUAL BASIC FUNDAMENTALS (20)

Ms vb
Ms vbMs vb
Ms vb
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)
 
Ppt on visual basics
Ppt on visual basicsPpt on visual basics
Ppt on visual basics
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
Ch01
Ch01Ch01
Ch01
 
Introduction to Visual Basic
Introduction to Visual Basic Introduction to Visual Basic
Introduction to Visual Basic
 
Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Vb lecture
Vb lectureVb lecture
Vb lecture
 
Book management system
Book management systemBook management system
Book management system
 
Getting started with test complete 7
Getting started with test complete 7Getting started with test complete 7
Getting started with test complete 7
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure below
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 

Mehr von sagaroceanic11

Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reportssagaroceanic11
 
Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensicssagaroceanic11
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimessagaroceanic11
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attackssagaroceanic11
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attackssagaroceanic11
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidencesagaroceanic11
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computerssagaroceanic11
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays worldsagaroceanic11
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mwaresagaroceanic11
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overviewsagaroceanic11
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisationsagaroceanic11
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecyclesagaroceanic11
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3sagaroceanic11
 
Rubyforjavaprogrammers 1210167973516759-9
Rubyforjavaprogrammers 1210167973516759-9Rubyforjavaprogrammers 1210167973516759-9
Rubyforjavaprogrammers 1210167973516759-9sagaroceanic11
 

Mehr von sagaroceanic11 (20)

Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reports
 
Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensics
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimes
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attacks
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attacks
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidence
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computers
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays world
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mware
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
 
Virtualisation basics
Virtualisation basicsVirtualisation basics
Virtualisation basics
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisation
 
6 service operation
6 service operation6 service operation
6 service operation
 
5 service transition
5 service transition5 service transition
5 service transition
 
4 service design
4 service design4 service design
4 service design
 
3 service strategy
3 service strategy3 service strategy
3 service strategy
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecycle
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3
 
Vb essentials
Vb essentialsVb essentials
Vb essentials
 
Rubyforjavaprogrammers 1210167973516759-9
Rubyforjavaprogrammers 1210167973516759-9Rubyforjavaprogrammers 1210167973516759-9
Rubyforjavaprogrammers 1210167973516759-9
 

Kürzlich hochgeladen

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Kürzlich hochgeladen (20)

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 

VISUAL BASIC FUNDAMENTALS

  • 2. A Brief History of Basic · Language developed in early 1960's at Dartmouth College: B (eginner's) A (All-Purpose) S (Symbolic) I (Instruction) C (Code) · Answer to complicated programming languages (FORTRAN, Algol, Cobol ...). First timeshare language.
  • 3. A Brief History of Basic . In the mid-1970's, two college students write first Basic for a microcomputer (Altair) - cost $350 on cassette tape. You may have heard of them: Bill Gates and Paul Allen! · Every Basic since then essentially based on that early version. Examples include: GW-Basic, QBasic, QuickBasic. · Visual Basic was introduced in 1991.
  • 4. Visual Basic versions Visual Basic 6.0 versus Other Versions of Visual Basic · The original Visual Basic for DOS and Visual Basic For Windows were introduced in 1991. · Visual Basic 3.0 (a vast improvement over previous versions) was released in 1993. · Visual Basic 4.0 released in late 1995 (added 32 bit application support). · ·
  • 5. Visual Basic versions Visual Basic 5.0 released in late 1996. New environment, supported creation of ActiveX controls, deleted 16 bit application support. · And, now Visual Basic 6.0 - some identified new features of Visual Basic 6.0: Þ Faster compiler Þ New ActiveX data control object Þ Allows database integration with wide variety of applications Þ New data report designer Þ New Package & Deployment Wizard Þ Additional internet capabilities
  • 6. What is Visual Basic ? • A high level programming language • Created by Microsoft • Uses a graphic environment called Integrated Development Environment (IDE) • Capable of developing Windows-based applications and games • Event –driven language • Made up of many subprograms , each with its own codes that can run independently, and at the same time can be linked together
  • 7. DEFINITION OF TERMS 1. Application - collection of objects that works together to accomplish a certain task/s for its users Examples: MS Word, Adobe Photoshop, Corel Draw 2. Project - the term used in Visual Basic pertaining to Application Examples: Payroll System, Quiz Bee Scoring Program
  • 8. DEFINITION OF TERMS 3. Object – a piece of software that has properties and functions that can be managed or controlled Examples: window, dialog box
  • 9. DEFINITION OF TERMS 4. Property – characteristic of an object Examples: color, size, background 5. Method – functions of an object that can be manipulated Examples: opening, resizing, moving (of a window)
  • 10. DEFINITION OF TERMS 6.Object-Oriented Environment – a place wherein application is created using objects and combining them to produce an output 7. Event – an action that happens Examples: clicking of a button, clicking of a menu, loading of form
  • 11. DEFINITION OF TERMS 8. Event- Driven – an operation is executed as the result of some kind of event 9. Form – the first object you will see on the screen when you open Visual Basic - it is where all the controls are placed - it is also where you will enter data and see the results 10. Controls –the object you put on a form Examples: text box, label, command
  • 12. DEFINITION OF TERMS 11. Code -computer instructions written by the programmer indicates what the action or result will be when an event occurs Examples: getting the total of 2 numbers once the button is clicked pop-up message appear 12.Script – other name for code 13. Design time - time when you visually design and layout the forms and object in it 14. Run Time - time when the program is executed
  • 13. Why is operation event –driven?
  • 14. The Main Window consists of the title bar, menu bar, and toolbar. Title bar indicates the project name, the current Visual Basic operating mode, and the current form. Menu bar has drop-down menus from which you control the operation of the Visual Basic environment.
  • 15.
  • 16.  Toolbar has buttons that provide shortcuts to some of the menu options.  The Main window also shows the location of the current form relative to the upper left corner of the screen (measured in twips) and the width and length of the current form.
  • 17. The Form Window is central to developing Visual Basic applications. It is where you draw your application.
  • 18. The Toolbox is the selection menu for controls used in your application.
  • 19. The Properties Window is used to establish initial property values for objects. The drop-down box at the top of the window lists all objects in the current form. Two views are available: Alphabetic and Categorized. Under this box are the available properties for the currently selected object.
  • 20.
  • 21. The Form Layout Window shows where (upon program execution) your form will be displayed relative to your monitor’s screen:
  • 22. The Project Window displays a list of all forms and modules making up your application. You can also obtain a view of the Form or Code windows (window containing the actual Basic coding) from the Project window.
  • 24.
  • 25.
  • 26.
  • 27. Take note: Properties Window Alignment = how text aligns in the control Back Color = choose the color of the background Caption = the text that will appear in the control Font = choose the font type and size Fore Color = choose the color of the text (foreground) Remember: Save the project as often as it should be.
  • 28. To switch between the Code window and the Form window, use the buttons just over the Project Explorer window (diagram on the left).
  • 29. Tips on Improving your application -write the simplest program that you understand and make it work - even if it doesn't have color or fancy fonts, test it and then save it; -make a copy of your previous working program and code one or two improvements in the copy - repeat for every improvement you make, using small steps so that if something does go wrong its easier to identify the source of the problem
  • 30. Avoid repeating code! The way to correct the application is to take all the code that repeats and put it into a separate procedure. A procedure is identified by the Private Sub ... End Sub lines. Call the procedure simply by writing its name.
  • 31. Writing code Code Editor Cut, Copy, Paste, Find, Replace
  • 32. GOOD HABITS: 1.Use comments 2.Use indents 3.Use standard capitalization 4.Write extra-long statements on 2 lines using the continuation character _ (space underscore)
  • 34. Variables and Constants VARIABLE  are used by Visual Basic to hold information needed by your application  sign or a name that stands for a particular value in a program  may store a data while the program is running
  • 35. These are the rules to follow when naming elements in VB - variables, constants, controls, procedures, and so on: A name must begin with a letter. May be as much as 255 characters Naming Conventions
  • 36. Naming Conventions  Must not contain a space or an embedded period or type-declaration characters used to specify a data type ; these are ! # % $ & @  Must not be a reserved word (that is part of the code, like Option, for example).  The dash, although legal, should be avoided because it may be confused with the minus sign. Instead of Family-name use Familyname or FamilyName.
  • 37. Declaring Variables Explicit Declaration – variable is declared at the beginning of the procedure in the Declaration Section Dim Num_1 as Integer Dim Age as String Dim Reg_DOB as Date
  • 38. Implicit Variables – variables is not formally declared - it is a result from other variable declarations Dim Total1 As Integer 'Explicit declaration Dim Total2 As Integer 'Explicit declaration Total3 = Total1 + Total2 'Implicit declaration
  • 39. The term Scope refers to whether the variable is available outside the procedure in which it appears. The scope is procedure-level or module-level. A variable declared with Dim at the beginning of a procedure is only available in that procedure. Scope of Variables
  • 40. Public Statement - variable can be used in several forms of the project Private Statement - variable can only be used in the form it is declared
  • 41.
  • 42.  Module-level – variables declared in the declarations section of the module - available only for the control in the form  Procedure-level - variables is declared inside a procedure is called - the original value will go back to its default value once it is called
  • 43. Constant – stores a value that does not change the value during the execution of the procedure Types of Constants Intrinsic Constants – defined by Visual Basic vbTrue vbBlack
  • 44. User-Defined Constants – defined by programmers that write the code Const Pi = 3.1416 Const Max_Num = 100 Object Browser - displays all the intrinsic constants that are related to the properties of the controls being created, including the procedures and modules define for the object
  • 45. Operators Mathematical and Text operators Operator Definition Example Result ^ Exponent (power of) 4 ^ 2 16 * Multiply 5 * 4 20 / Divide 20 / 4 5 + Add 3 + 4 7 - Subtract 7 – 3 4 Mod Remainder of division 20 Mod 6 2 Integer division 20 6 3 & String concatenation "Joan" & " " & "Smith" "Joan Smith" Note that the order of operators is determined by the usual rules in programming. When a statement includes multiple operations the order of operations is: Parentheses ( ), ^, *, /, , Mod, +, -
  • 46. Logical operators Operator Definition Example Result = Equal to 9 = 11 False > Greater than 11 > 9 True < Less than 11 < 9 False >= Greater or equal 15 >= 15 True <= Less or equal 9 <= 15 True <> Not equal 9 <> 9 False AND Logical AND (9 = 9) AND (7 = 6) False OR Logical OR (9 = 9) OR (7 = 6) True
  • 47. Select Case Can be used as an alternative to the If...Then...Else structure, especially when many comparisons are involved. Select Case ShirtSize Case 1 SizeName.Caption = "Small" Case 2 SizeName.Caption = "Medium" Case 3 SizeName.Caption = "Large" Case 4 SizeName.Caption = "Extra Large" Case Else SizeName.Caption = "Unknown size" End Select
  • 48. Do...Loop Used to execute a block of statements an unspecified number of times. Do While condition statements Loop First, the condition is tested; if condition is True, then the statements are executed. When it gets to the Loop it goes back to the Do and tests condition again. If condition is False on the first pass, the statements are never executed.
  • 49. For...Next When the number of iterations of the loop is known, it is better to use the For...Next rather than the Do...Loop. For counter = start To end statements Next 1) The counter is set to the value of start. 2) Counter is checked to see if it is greater than end; if yes, control passes to the statement after the Next; if not the statements are executed. 3)At Next, counter is incremented and goes back to step 2).