0% found this document useful (0 votes)
1 views8 pages

Introduction To VB 6

The document provides an overview of programming languages, detailing their types such as machine language, assembly language, structured programming, procedural programming, object-oriented programming, and event-driven programming. It also introduces graphical user interfaces (GUIs) and discusses the history and features of Visual Basic, a user-friendly event-driven programming language. The document outlines the development process of Visual Basic applications and describes the Integrated Development Environment (IDE) used for creating them.

Uploaded by

Ningombam Jimson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views8 pages

Introduction To VB 6

The document provides an overview of programming languages, detailing their types such as machine language, assembly language, structured programming, procedural programming, object-oriented programming, and event-driven programming. It also introduces graphical user interfaces (GUIs) and discusses the history and features of Visual Basic, a user-friendly event-driven programming language. The document outlines the development process of Visual Basic applications and describes the Integrated Development Environment (IDE) used for creating them.

Uploaded by

Ningombam Jimson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

PROGRAMMING LANGUAGE

Programming means designing a set of instructions to instruct the computer to carry out certain jobs that
are very much faster than human beings can do. The earliest programming language is called machine language
which uses the binary code (comprises 0 and 1) to communicate with the computer. However, the machine
language is extremely difficult to learn. Fortunately, scientists have invented some high-level programming
languages that are much easier to master. Among the high-level programming languages are Java, Javascript, C,
C++, c# and Visual Basic.
Different types of programming language
Machine and assembly language
A machine language consists of the numeric codes for the operations that a particular computer can
execute directly. The codes are strings of 0s and 1s, or binary digits (“bits”), which are frequently converted both
from and to hexadecimal (base 16) for human viewing and modification. Machine language instructions typically
use some bits to represent operations, such as addition, and some to represent operands, or perhaps the location
of the next instruction. Machine language is difficult to read and write, since it does not resemble conventional
mathematical notation or human language, and its codes vary from computer to computer.
Assembly language is one level above machine language. It uses short mnemonic codes for instructions
and allows the programmer to introduce names for blocks of memory that hold data. One might thus write “add
pay, total” instead of “0110101100101000” for an instruction that adds two numbers. Assembly language is
designed to be easily translated into machine language.
Structured Programming
It is a programming approach in which the program is made as a single structure. It means that the code will
execute the instruction by instruction one after the other. It doesn’t support the possibility of jumping from one
instruction to some other with the help of any statement like GOTO, etc. Therefore, the instructions in this
approach will be executed in a serial and structured manner. The languages that support Structured programming
approach are:
 C , C++, Java, C#
On the contrary, in the Assembly languages like Microprocessor 8085, etc, the statements do not get
executed in a structured manner. It allows jump statements like GOTO. So the program flow might be random.
The structured program mainly consists of three types of elements:
 Selection Statements
 Sequence Statements
 Iteration Statements

Procedure Programming language


Procedural Programming can be defined as a programming model which is derived from structured programming,
based upon the concept of calling procedure. Procedures, also known as routines, subroutines or functions, simply
consist of a series of computational steps to be carried out. During a program’s execution, any given procedure
might be called at any point, including by other procedures or itself.
Languages used in Procedural Programming:
FORTRAN, ALGOL, COBOL, BASIC, Pascal and C.
Object Oriented Programming:
Object oriented programming can be defined as a programming model which is based upon the concept of objects.
Objects contain data in the form of attributes and code in the form of methods. In object oriented programming,
computer programs are designed using the concept of objects that interact with real world. Object oriented
programming languages are various but the most popular ones are class-based, meaning that objects are instances
of classes, which also determine their types.
Languages used in Object Oriented Programming:
Java, C++, C#, Python, PHP, JavaScript, Ruby, Perl, Objective-C, Dart, Swift, Scala.
Difference between Procedural Programming and Object Oriented Programming:
Procedural Oriented Programming Langauge Object Oriented Programming Langauge
In procedural programming, program is divided into In object oriented programming, program is divided
small parts called functions. into small parts called objects.
Procedural programming follows top down approach. Object oriented programming follows bottom up
approach.
There is no access specifier in procedural Object oriented programming have access specifiers
programming. like private, public, protected etc.
Adding new data and function is not easy. Adding new data and function is easy.
Procedural programming does not have any proper Object oriented programming provides data hiding so
way for hiding data so it is less secure. it is more secure.
In procedural programming, overloading is not Overloading is possible in object oriented
possible. programming.
In procedural programming, function is more In object oriented programming, data is more
important than data important than function.
Procedural programming is based on unreal world. Object oriented programming is based on real world.
Examples: C, FORTRAN, Pascal, Basic etc. Examples: C++, Java, Python, C# etc.

Event Driven Programming


Event-driven programming is a programming paradigm in which the flow of program execution is
determined by events - for example a user action such as a mouse click, key press, or a message from the operating
system or another program. An event-driven application is designed to detect events as they occur, and then deal
with them using an appropriate event-handling procedure. Event-driven programs can be written in any
programming language, although some languages(Visual Basic for example) are specifically designed to facilitate
event-driven programming, and provide an integrated development environment (IDE) that partially automates
the production of code, and provides a comprehensive selection of built-in objects and controls, each of which
can respond to a range of events. Virtually all object-oriented and visual languages support event-driven
programming. Visual Basic, Visual C++ and Java are examples of such languages.
Within an event-driven programming environment, standard events are usually identified using the ID of
the object affected by the event (e.g. the name of a command button on a form), and the event ID (e.g. "left-
click"). The information passed to the event-handler may include additional information, such as
the x and y coordinates of the mouse pointer at the time the event occurred, or the state of the Shift key (if the
event in question is a key-press).
INTRODUCTION TO GUI
A graphical user interface (GUI) is a way for human/user to interact with computer. A GUI uses windows,
icons and menus etc. which can be manipulated by mouse and often to a limited extend by keyboard as well.
A windows is a rectangular portion of the monitor screen that can display its content, eg: a program, icon,
a textfile or an image, which is apparently independent from the rest of the display screen. An Icon is a small
picture or symbol in GUI that represent a program, a file, a directory or a device. Icons are used both on desktop
and within application programs. Eg. Small rectangles (to represent files), file folder (to represent directories), a
trash can (to indicate a place to dispose of unwanted files and directories).
In GUI, command are issued by using a mouse, trackball, or a touch pad to first move a pointer on the
screen to, or top of , icon, menu items or windows of interest to select that object. Icons and windows can be
moved by dragging and object or programs can be opened by clicking their icon.
Advantages of GUI
- The major advantage of GUI is that they make computer operation easier to learn and use.
- GUI generally provide users with immediate, visual feedbacks about the effect of each action.
- GUI allow user to take full advantage of powerfull multitasking capabilities by allowing multiple
programs/instances to be displayed simultaneously which results in the large increase in the flexibility of
computer use and a consequent rise in user productivity.
Brief History about GUI
The origin of GUI can be traced back to Vannevar Bush, a scientist who worked at MIT (Massachusetts Institute
of Technology) during World War II. Bush proposed an information administration tools name Memex that would
allow data to be stored on microfilm and made easily accessible, linkable with hyperlink and programmable.
In 1963, Ivan Sutherland developed a program called sketchpad, which allowed direct manipulation of graphics
object on a CRT screen using a light pen. His concept include the capability to zoom in and out on the display,
the provision of memory for storing objects and the ability to draw precision lines and corners on the screen.
Douglas Engelbart in the early 1950s, was greatly inspired by Bush concepts. He unveiled the first primitive
mouse in 1968 at the Fall Joint Computer Conference in San Francisco. Termed X-Y position indicator, it was
housed in a small wooden box with wheels and it took the cursors with it on the display screen when it was rolled
around horizontal surface.
Much additional progress occurred at Xerox Palo Alto Research Center (PARC), which Xerox Corporation
established in 1970 in Palo Alto, California for the purpose of creating “the architecture of information” and
“humanizing computers.” This included developing the first usable GUI, which was incorporated into PARC’s
Alto computer. The Alto, which debuted in 1974, was envisioned as a smaller, more portable replacement for
the mainframes that dominated computing at that time. However, it and its successor, the Xerox Star, never
achieved commercial success, presumably due to their very high prices.
Steve Jobs, the co-founder of Apple Computer, was highly inspired by the innovations at nearby PARC, and he
thus decided to incorporate a GUI into his company’s computers. Apple considerably extended PARC’s work,
including developing overlapping windows, manipulable icons, a fixed menu bar, dropdown menus and a trash
can. The Apple Macintosh, launched in 1984, was the first commercially successful use of a GUI. It was so
successful, in fact, that the GUI was subsequently adopted by most other developers of operating systems and
application software, and it is now used on (or at least available for) virtually all types of computers.
Microsoft announced development of its first operating system that incorporated a GUI in November 1983, and
the initial version, Windows 1.0, was released in November 1985. Windows 2.0, released in December 1987,
represented a major improvement over the primitive Windows 1.0 with its addition of icons and overlapping
windows, but it was not until 1995 with the launching of Windows 95 that Microsoft was able to offer a relatively
high quality GUI.
INTRODUCTION TO VISUAL BASIC PROGRAMMING
Visual Basic is a third-generation event-driven programming language first released by Microsoft in 1991.
It evolved from the earlier DOS version called BASIC. BASIC means Beginners' All-
purpose Symbolic Instruction Code. Since then Microsoft has released many versions of Visual Basic, from
Visual Basic 1.0 to the final version Visual Basic 6.0. Visual Basic is a user-friendly programming language
designed for beginners, and it enables anyone to develop GUI window applications easily.

In 2002, Microsoft released Visual Basic.NET(VB.NET) to replace Visual Basic 6. Thereafter, Microsoft
declared VB6 a legacy programming language in 2008. Fortunately, Microsoft still provides some form of support
for VB6. VB.NET is a fully object-oriented programming language implemented in the .NET Framework. It was
created to cater for the development of the web as well as mobile applications. However, many developers still
favor Visual Basic 6.0 over its successor Visual Basic.NET.

In VB 6, you can create any program depending on your objective. For math teachers, you can create
mathematical programs such as Geometric Progression, Quadratic Equation Solver, Simultaneous Equation
Solver ,Prime Number Tester, Factors Finder, Quadratic Function Graph Plotter and so on. For science teachers,
you can create simulation programs such as Projectile, Simple Harmonic Motion, Star War etc. If you are in
business, you can also create business applications such as inventory management system , Amortization
Calculator , investments calculator, point-of-sale system, payroll system, accounting program and more to help
manage your business and increase productivity. For those of you who like games , you can create programs such
as slot machine, reversi, tic tac toe and more. Besides, you can create multimedia programs such as Smart Audio
Player, Multimedia Player and more.

Visual Basic is event-driven, meaning code remains idle until called upon to respond to some event
(button pressing, menu selection, ...). Visual Basic is governed by an event processor. Nothing happens until an
event is detected. Once an event is detected, the code corresponding to that event (event procedure) is executed.
Program control is then returned to the event processor.

Features of Visual Basics

- Full set of objects - you 'draw' the application


- Lots of icons and pictures for your use
- Response to mouse and keyboard actions
- Clipboard and printer access
- Full array of mathematical, string handling, and graphics functions
- Can handle fixed and dynamic variable and control arrays
- Sequential and random access file support
- Useful debugger and error-handling facilities
- Powerful database access tools
- ActiveX support
- Package & Deployment Wizard makes distributing your applications simpl
In Visual Basic, Application (Project) is made up of
- Forms - Windows that you create for user interface
- Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars,
command buttons, etc.) (Forms and Controls are objects.)
- Properties - Every characteristic of a form or control is specified by a property. Example properties
include names, captions, size, color, position, and contents. Visual Basic applies default properties. You
can change properties at design time or run time.
- Methods - Built-in procedure that can be invoked to impart some action to a particular object.
- Event Procedures - Code related to some object. This is the code that is executed when a certain event
occurs.
- General Procedures - Code not related to objects. This code must be invoked by the application.
- Modules - Collection of general procedures, variable declarations, and constant definitions used by
application.
Steps of Developing VB application
There are three primary steps involved in building a Visual Basic application:
o Draw the user interface
o Assign properties to controls
o Attach code to controls
Visual Basic operates in three modes.
- Design mode - used to build application
- Run mode - used to run the application
- Break mode - application halted and debugger is available

The Visual Basic 6 Integrated Development Environment


Visual basic is not just a language. It’s an Integrated Development Environment in which we can developed, run,
test and debug our application. On startup, Visual Basic 6.0 will display the following dialog box as shown in
Figure 1.1.

Standard EXE: A Standard EXE project is a typical application. Most of the application we are going to discuss
are Standard EXE project. These are type of applications we can developed with the previous version of Visual
basics.
Six windows appears when you start Visual Basic.
1. The Main Windows: The Main Window consists of the title bar, menu bar, and toolbar. The title bar
indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar
has drop-down menus from which you control the operation of the Visual Basic environment. The 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 and the width and length of the current
form.

2. The Form Windows: The Form Window is central to developing Visual Basic applications. It is where
you draw your application.
3. The Toolbox: The Toolbox is the selection menu for controls used in your application.

4. The Properties Windows: 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.

5. The Form Layout Windows: The Form Layout Window shows where (upon program execution) your
form will be displayed relative to your monitor’s screen:
6. The Project Windows: 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.

You might also like