Computer Science II

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

‫‪University Of Kirkuk‬‬

‫‪College Of Pharmacy‬‬

‫)‪(Visual Basic‬‬

‫االسم الطالة‪ :‬ديار دمحم رحيم كريم‬


‫المرحلة‪ :‬الثانية‬
‫الكروب‪C:‬‬
‫البريد االلكتروني‪[email protected] :‬‬
‫المشرفة‪ :‬د‪ .‬نور فيصل‬
Introduction:

A version of the BASIC programming language from Microsoft specialized for


developing Windows applications. When first released in 1991, it was similar to
Microsoft's QuickBASIC. With its visual user interface development tools, Visual
Basic became very popular by the mid-1990s. Visual Basic 6.0, which was
released in early 1999, was the last version of Visual Basic to be offered as a stand-
alone development product. Visual Basic became part of Visual
Studio.NET.Visual Basic for Applications (VBA) is a subset that provides a
common macro language included with many Microsoft applications.
Up until VB 5, the Visual Basic compiler only converted the source code written
by the programmer into an intermediate language called "bytecode." Starting with
VB 5, native executable programs can be generated.

Objective:

Visual Basic provides full support for object-oriented programming including


encapsulation, inheritance, and polymorphism. Encapsulation means that a group
of related properties, methods, and other members are treated as a single unit
or object.

Compilation:

Visual Basic Uses Bytecode


Similar to Java, Visual Basic is compiled into an intermediate language called
"bytecode." The bytecode is translated into x86 machine language by the
Visual Basic runtime module.

No matter what the version, in order to run a VB program, the VB runtime module
must reside in the target computer. This .DLL file, named VBRUNxxx (up to VB
4) or MSVBVMxx (VB 5 and 6), where x is the version number, contains
necessary runtime libraries and also converts programs compiled to bytecode into
the machine language of the computer. The runtime DLLs are widely available and
typically accompany a Visual Basic application. See VB.NET and VBScript.

Characteristics:
 Instead of being identified by line number alone, code may be grouped into
named subroutines or methods: Sub...End Sub. Visual Basic supports user-
added line numbers through version 6, or later.
 Code Statements have no terminating character other than a line ending
(carriage return/line feed). Versions since at least VB 3.0 allowed that
statements can be implicitly multi-line with concatenation of strings or
explicitly using the underscore character (_) at the end of lines.
 Code comments are done with a single apostrophe (') character. ' This is a
comment
 Looping statement blocks begin and end with keywords: Do...Loop,
While...End While, For...Next .
 Multiple variable assignment is not possible. A = B = C does not imply that
the values of A, B and C are equal. The Boolean result of "Is B = C?" is
stored in A. The result stored in A would therefore be either false or true.
 Boolean constant True has numeric value −1. This is because the Boolean
data type is stored as a two's complement signed integer.
 Logical and bitwise operators are unified. This is unlike some C-derived
languages (such as Perl), which have separate logical and bitwise operators.
This again is a traditional feature of BASIC.
 Variable array base. Arrays are declared by specifying the upper and lower
bounds in a way similar to Pascal and Fortran.
 Relatively strong integration with the Windows operating system and
the Component Object Model. The native types for strings and arrays are the
dedicated COM types, BSTR and SAFEARRAY.
 Banker's rounding as the default behavior when converting real numbers to
integers with the Round function.
 Integers are automatically promoted to reals in expressions that involve the
normal division operator ( / ) so that division of one integer by another
produces the intuitively correct result. VB provides a specific integer divide
operator ( \ ) that does truncate.
 By default, if a variable has not been declared or if no type declaration
character is specified, the variable is of type Variant

Applications:

 Visual Basic for Applications is a computer programming language


developed and owned by Microsoft.
 With VBA you can create macros to automate repetitive word- and data-
processing functions, and generate custom forms, graphs, and reports.
 VBA functions within MS Office applications; it is not a stand-alone
product.

References:

1. www.wiki.org
2. www.investopedia.com
3. www.pcmag.com

You might also like