Вы находитесь на странице: 1из 10

ASSIGNMENT

OF
VISUAL BASIC
S.NO TOPIC PAGE NO

1. Features of oops 1-2

2. Features of visual basic 3-4

3. Difference between visual basic and 5


VB.net

4. Visual basic applications 6

5. Types of errors 7

6. How a visual basic application is 8


compiled and run
Features of oops

 Inheritance
 Polymorphism
 Data Hiding
 Encapsulation
 Overloading
 Reusability

Let us see a brief overview of these important features of Object Oriented programming
but before that it is important to know some new terminologies used in Object Oriented programming
namely

 Objects
 Classes

Objects:

In other words object is an instance of a class.

Classes:

These contain data and functions bundled together under a unit. In other words class is a collection
of similar objects. When we define a class it just creates template or Skelton. So no memory is
created when class is created. Memory is occupied only by object.

Member functions:

The functions defined inside the class as above are called member functions.
Here the concept of Data Hiding figures

Data Hiding:

This concept is the main heart of an Object oriented programming. The data is hidden inside the
class by declaring it as private inside the class. When data or functions are defined as private it can
be accessed only by the class in which it is defined. When data or functions are defined as public
then it can be accessed anywhere outside the class. Object Oriented programming gives importance
to protecting data which in any system. This is done by declaring data as private and making it
accessible only to the class in which it is defined. This concept is called data hiding. But one can keep
member functions as public.
Encapsulation:

The technical term for combining data and functions together as a bundle is encapsulation.

Inheritance:
1
Inheritance as the name suggests is the concept of inheriting or deriving properties of an exiting
class to get new class or classes. In other words we may have common features or characteristics
that may be needed by number of classes. So those features can be placed in a common tree class
called base class and the other classes which have these charaterisics can take the tree class and
define only the new things that they have on their own in their classes. These classes are called
derived class. The main advantage of using this concept of inheritance in Object oriented
programming is it helps in reducing the code size since the common characteristic is placed
separately called as base class and it is just referred in the derived class. This provide the users the
important usage of terminology called as reusability

Reusability:

This usage is achieved by the above explained terminology called as inheritance. Reusability is
nothing but re- usage of structure without changing the existing one but adding new features or
characteristics to it. It is very much needed for any programmers in different situations. Reusability
gives the following advantages to usersIt helps in reducing the code size since classes can be just
derived from existing one and one need to add only the new features and it helps users to save their
time. For instance if there is a class defined to draw different graphical figures say there is a user
who want to draw graphical figure and also add the features of adding color to the graphical figure.
In this scenario instead of defining a class to draw a graphical figure and coloring it what the user can
do is make use of the existing class for drawing graphical figure by deriving the class and add new
feature to the derived class namely add the feature of adding colors to the graphical figure.

Polymorphism and Overloading:

Poly refers many. So Polymorphism as the name suggests is a certain item appearing in different
forms or ways. That is making a function or operator to act in different forms depending on the
place they are present is called Polymorphism. Overloading is a kind of polymorphism. In other
words say for instance we know that +, – operate on integer data type and is used to perform
arithmetic additions and subtractions. But operator overloading is one in which we define new
operations to these operators and make them operate on different data types in other words
overloading the existing functionality with new one. This is a very important feature of object
oriented programming methodology which extended the handling of data type and operations.
Features of visual basic

Arrays
Discusses making your code more compact and powerful by declaring and using arrays, which hold
multiple related values.

Collection Initializers
Describes collection initializers, which enable you to create a collection and populate it with an initial
set of values.

Constants and Enumerations


Discusses storing unchanging values for repeated use, including sets of related constant values.

Control Flow
Shows how to regulate the flow of your program's execution.

Data Types
Describes what kinds of data a programming element can hold and how that data is stored.

Declared Elements
Covers programming elements you can declare, their names and characteristics, and how the
compiler resolves references to them.

Delegates
Provides an introduction to delegates and how they are used in Visual Basic.

Early and Late Binding


Describes binding, which is performed by the compiler when an object is assigned to an object
variable, and the differences between early-bound and late-bound objects.

Error Types
Provides an overview of syntax errors, run-time errors, and logic errors.
Events
Shows how to declare and use events.
3

Interfaces
Describes what interfaces are and how you can use them in your applications.

LINQ
Provides links to topics that introduce Language-Integrated Query (LINQ) features and programming.

Objects and Classes


Provides an overview of objects and classes, how they are used, their relationships to each other,
and the properties, methods, and events they expose.

Operators and Expressions


Describes the code elements that manipulate value-holding elements, how to use them efficiently,
and how to combine them to yield new values.

Procedures
Describes Sub, Function, property, and operator procedures, as well as advanced topics such as

recursive and overloaded procedures.

Statements
Describes declaration and executable statements.

Strings
Provides links to topics that describe the basic concepts about using strings in Visual Basic.

Variables
Introduces variables and describes how to use them in Visual Basic.

XML
Provides links to topics that describe how to use XML in Visual Basic.
Difference between visual basic and VB.net

Visual basic VB.net 4


1.VB is its procedural language and it’s no VB.net is a modern,object oriented language
longer actively maintained

2.The VB classic IDE is unsupported as of VB .net applications can be developed with visual
april 8,2008 studio, the most recent version in 2013

3.VB used the VB runtime environment VB.net uses the .net common language runtime(CLR)

4.VB was interpreter based language Vb.net is a compiled language

5.VB does not allow developing the VB.net we can create multithreaded applications
multithreaded application

6. VB was only considered good for In VB.net we can also develop web application
desktop windows applications ,distributed application ,create .net windows ,web
control and components write windows and web
services

7. VB lot of code was hidden from In VB .net is no code is hidden from developer we can
developer access and control each parts

8. VB was not a typesafe language VB.net is typesafe language

9.VB used ASP to build web application VB.net uses APS.net to build web application

10. in VB web services tods are not In VB.net language web services tools are available
available

11. platform dependent Platform independent


Visual basic application
Visual Basic for Applications (VBA) is an implementation
5 of Microsoft's event-driven programming
language Visual Basic 6, which was discontinued in 2008, and its associated integrated development
environment (IDE). Although Visual Basic is no longer supported or updated by Microsoft, VBA itself
got upgraded in 2010 with the introduction of Visual Basic for Applications 7 in Microsoft Office
applications.

Visual Basic for Applications enables building user-defined functions (UDFs), automating processes
and accessing Windows API and other low-level functionality through dynamic-link libraries (DLLs). It
supersedes and expands on the abilities of earlier application-specific macro programming languages
such as Word's WordBasic. It can be used to control many aspects of the host application, including
manipulating user interface features, such as menus and toolbars, and working with custom user
forms or dialog boxes.

As its name suggests, VBA is closely related to Visual Basic and uses the Visual Basic Runtime Library.
However, VBA code normally can only run within a host application, rather than as a standalone
program. VBA can, however, control one application from another using OLE Automation. For
example, VBA can automatically create a Microsoft Word report from Microsoft Excel data that Excel
collects automatically from polled sensors. VBA can use, but not create, ActiveX/COM DLLs, and later
versions add support for class modules.

VBA is built into most Microsoft Office applications, including Office for Mac OS X (except version
2008), and other Microsoft applications, including Microsoft MapPoint and Microsoft Visio. VBA is
also implemented, at least partially, in applications published by companies other than Microsoft,
including ArcGIS, AutoCAD, CorelDraw, LibreOffice, Reflection, SolidWorks, and WordPerfect.
Types of Errors (Visual Basic) 6

In Visual Basic, errors (also called exceptions) fall into one of three categories: syntax errors, run-
time errors, and logic errors.

Syntax Errors

Syntax errors are those that appear while you write code. Visual Basic checks your code as you type
it in the Code Editor window and alerts you if you make a mistake, such as misspelling a word or
using a language element improperly. Syntax errors are the most common type of errors. You can fix
them easily in the coding environment as soon as they occur.

Run-Time Errors

Run-time errors are those that appear only after you compile and run your code. These involve code
that may appear to be correct in that it has no syntax errors, but that will not execute. For example,
you might correctly write a line of code to open a file. But if the file is corrupted, the application
cannot carry out the Open function, and it stops running. You can fix most run-time errors by
rewriting the faulty code, and then recompiling and rerunning it.

Logic Errors

Logic errors are those that appear once the application is in use. They are most often unwanted or
unexpected results in response to user actions. For example, a mistyped key or other outside
influence might cause your application to stop working within expected parameters, or altogether.
Logic errors are generally the hardest type to fix, since it is not always clear where they originate.
How a visual basic application is compiled7 and run

VB

VB compiler

MSIL/IL

Common language runtime

JIT(just in time )compiler

Motive code