Professional Documents
Culture Documents
BASIC COMPUTER
BSIT-2ND YEAR
PROGRAMMING LANGUAGE
A programming language is a formal constructed languagedesigned to communicate instructions to a machine,
particularly a computer. Programming languages can be used to createprograms to control the behavior of a
machine or to expressalgorithms.
The earliest programming languages preceded the invention of the digital computer and were used to direct the
behavior of machines such as Jacquard looms and player pianos.Thousands of different programming languages
have been created, mainly in the computer field, and many more still are being created every year. Many
programming languages require computation to be specified in an imperative form (i.e., as a sequence of
operations to perform), while other languages utilize other forms of program specification such as
thedeclarative form (i.e. the desired result is specified, not how to achieve it).
The description of a programming language is usually split into the two components of syntax (form)
and semantics(meaning). Some languages are defined by a specification document (for example,
the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a
dominant implementation that is treated as a reference.
DEFINITION
A programming language is a notation for writing programs, which are specifications of a computation
or algorithm.[2] Some, but not all, authors restrict the term "programming language" to those languages that can
express all possible algorithms.[2][3] Traits often considered important for what constitutes a programming
language include:
Abstractions
Programming languages usually contain abstractions for defining and manipulating data structures or controlling the flow
of execution. The practical necessity that a programming language support adequate abstractions is expressed by
theabstraction principle;[8] this principle is sometimes formulated as recommendation to the programmer to make proper
use of such abstractions.[9]
Expressive power
The theory of computation classifies languages by the computations they are capable of expressing. All Turing
completelanguages can implement the same set of algorithms. ANSI/ISO SQL-92 and Charity are examples of
languages that are not Turing complete, yet often called programming languages.[10][11]
Markup languages like XML, HTML or troff, which define structured data, are not usually considered
programming languages.[12][13][14] Programming languages may, however, share the syntax with markup
languages if a computational semantics is defined. XSLT, for example, is a Turing complete XML
dialect.[15][16][17] Moreover, LaTeX, which is mostly used for structuring documents, also contains a Turing
complete subset.[18][19]
The term computer language is sometimes used interchangeably with programming language.[20] However, the
usage of both terms varies among authors, including the exact scope of each. One usage describes programming
languages as a subset of computer languages.[21] In this vein, languages used in computing that have a different
goal than expressing computer programs are generically designated computer languages. For instance, markup
languages are sometimes referred to as computer languages to emphasize that they are not meant to be used for
programming.[22]
Another usage regards programming languages as theoretical constructs for programming abstract machines,
and computer languages as the subset thereof that runs on physical computers, which have finite hardware
resources.[23] John C. Reynolds emphasizes that formal specification languages are just as much programming
languages as are the languages intended for execution. He also argues that textual and even graphical input
formats that affect the behavior of a computer are programming languages, despite the fact they are commonly
not Turing-complete, and remarks that ignorance of programming language concepts is the reason for many
flaws in input formats.[24]
VISUAL BASIC
Visual Basic is a third-generation event-driven programming languageand integrated development
environment (IDE) from Microsoft for itsCOM programming model first released in 1991. Microsoft intended
Visual Basic to be relatively easy to learn and use.[1][2] Visual Basic was derived from BASIC and enables
the rapid application development (RAD) of graphical user interface (GUI) applications, access
todatabases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation
of ActiveX controls and objects.
A programmer can create an application using the components provided by the Visual Basic program itself.
Over time the community of programmers have developed new third party components, keeping this
programming language to modern standards.[3][4][5][6][7] Programs written in Visual Basic can also use
the Windows API, which requires external function declarations. Furthermore, new third party functions (which
are open source) using part VB6 source code and part embedded machine code, make the Visual Basic 6.0
applications faster than those designed in C++.[3][8]
The final release was version 6 in 1998 (now known simply as Visual Basic). Though Visual Basic
6.0 IDE is unsupported as of April 8, 2008, the Visual Basic team is committed to It Just Works
compatibility for Visual Basic 6.0 applications on Windows Vista, Windows Server 2008including
R2, Windows 7, and Windows 8.[9] In 2014 there are hundreds of thousands of developers who still
prefer Visual Basic 6.0 over Visual Basic .NET.[3][10] Moreover, in recent years some developers
lobbied aggressively for a new version of Visual Basic 6.0.[11][12][13] [14] A dialect of Visual Basic, Visual
Basic for Applications (VBA), is used as a macro or scripting language within several Microsoft
applications, includingMicrosoft Office.[15]
Timeline Description
Visual Basic 1.0 (May 1991) was released for Windows at the Comdex/Windows World trade show in Atlanta, Georgia.
Visual Basic 1.0 for DOS was released in September 1992. The language itself was not quite compatible with Visual Basic for
Windows, as it was actually the next version of Microsoft's DOS-based BASIC compilers, QuickBASIC and BASIC
Professional Development System. The interface used a Text user interface, using extended ASCII characters to simulate the
appearance of a GUI.
Visual Basic 2.0 was released in November 1992. The programming environment was easier to use, and its speed was
improved. Notably, forms became instantiable objects, thus laying the foundational concepts of class modules as were later
offered in VB4.
Visual Basic 3.0 was released in the summer of 1993 and came in Standard and Professional versions. VB3 included version 1.1
of the Microsoft Jet Database Engine that could read and write Jet (or Access) 1.x databases.
Visual Basic 4.0 (August 1995) was the first version that could create 32-bit as well as 16-bit Windows programs. It has three
editions; Standard, Professional, and Enterprise. It also introduced the ability to write non-GUI classes in Visual Basic.
Incompatibilities between different releases of VB4 caused installation and operation problems. While previous versions of
Visual Basic had used VBX controls, Visual Basic now used OLE controls (with files names ending in .OCX) instead. These
were later to be named ActiveX controls.
With version 5.0 (February 1997), Microsoft released Visual Basic exclusively for 32-bit versions of Windows. Programmers
who preferred to write 16-bit programs were able to import programs written in Visual Basic 4.0 to Visual Basic 5.0, and Visual
Basic 5.0 programs can easily be converted with Visual Basic 4.0. Visual Basic 5.0 also introduced the ability to create custom
user controls, as well as the ability to compile to native Windows executable code, speeding up calculation-intensive code
execution. A free, downloadable Control Creation Edition was also released for creation ofActiveX controls. It was also used as
an introductory form of Visual Basic: a regular .exe project could be created and run in the IDE, but not compiled.
Visual Basic 6.0 (Mid-1998) improved in a number of areas[21] including the ability to create web-based applications. Visual
Basic 6.0 has entered Microsoft's "non-supported phase" as of March 2008. Windows Vista, Windows Server 2008 and
Windows 7, no longer support the Visual Basic 6.0 development environment, but still support the runtime.[22]Microsoft
announced in February 2012 that they support the runtime in Windows 8.[23]
Mainstream Support for Microsoft Visual Basic 6.0 ended on March 31, 2005. Extended support ended in March 2008.[24]In
response, the Visual Basic user community expressed its grave concern and lobbied users to sign a petition to keep the product
alive.[25] Microsoft has so far refused to change their position on the matter.[26] Ironically, around this time (2005), it was exposed
that Microsoft's new anti-spyware offering, Microsoft AntiSpyware (part of the GIANT Company Software purchase), was
coded in Visual Basic 6.0.[27] Its replacement, Windows Defender, was rewritten in C++.[28]
Above:
Clear and Exit are buttons named
cmdClear and cmdExit. The white box
is a text box named txtHello.
underlined in the caption, for this project.) Press the Enter key .
( N O T E : S o m e t i m e s yo u w i l l w a n t t o u n d e r l i n e a d i f f e r e n t l e t t e r i n
o t h e r p r o j e c t s . P l a c e t h e a m p e r s a n d b e f o r e t h e l e t t e r yo u w i s h t o
underline. Do not have the same letter underlined more than once in
a project window. Two different captions should not each have an
underlined D. Pick a different letter to underline when this happens.
S e l e c t a l e t t e r t h a t h a s n o t ye t b e e n u s e d t o u n d e r l i n e i n a c a p t i o n ) .
Name the third command button:
S e l e c t t h e t h i r d c o m m a n d b u t t o n s o t h a t yo u s e e t h e r e s i z i n g h a n d l e s
around the third command button. In the Properties window, double click on the (Name) property and name it cmdExit. Make the Caption
property E&xit with the ampersand before the x so that the x will be
u n d e r l i n e d . P r e s s t h e E n t e r k e y. N o w y o u h a v e n a m e d a n d l a b e l e d
t h e E x i t k e y.
SUMMARY: You have opened a standard .exe project and named the
project HelloWorld. The form was not renamed by me but is still
c a l l e d F o r m 1 . R e n a m e t h e f o r m i f yo u w i s h . Y o u h a v e p l a c e d o n e
t e x t b o x a n d 3 c o m m a n d b u t t o n s o n t o y o u r f o r m a n d yo u h a v e n a m e d
the controls and given the command buttons separate captions. (A
caption on a button is what the user sees on that button.) Text boxes
do not have a caption. Use the .text property for text boxes. You
have deleted default text fro m the text box control to make it appear
e m p t y, a n d h a v e n a m e d t h i s c o n t r o l , t x t H e l l o . N o w yo u w i l l c o d e t h e
command button controls.
To access the code window with a sub procedure already started for
you double-click on the cmdHello button with the capt ion that
r e a d s D i s p l a y H e l l o . T h i s d o u b l e - c l i c k a c t i o n t a k e s yo u t o t h e c o d e
w i n d o w w h e r e yo u s e e a l i n e r e a d i n g P r i v a t e S u b c m d H e l l o _ C l i c k ( )
a n d a n o t h e r l i n e r e a d i n g E n d S u b . P l a c e yo u r c u r s o r b e t w e e n t h e s e
t w o l i n e s a n d i n d e n t o n c e u s i n g t h e t a b k e y. T yp e
t x t H e l l o . T e x t = " H e l l o W o r l d ! " . U s e t h e q u o t e s t h i s t i m e w h e n t yp i n g
t h a t l i n e . P r e s s t h e E n t e r k e y. O n t h e n e x t l i n e i n d e n t o n c e u s i n g t h e
t a b k e y a n d t yp e W i t h t x t H e l l o , t h e n p r e s s t h e E n t e r k e y . O n t h e
next line indent twice using the tab key and
t yp e . f o n t = " A r i a l " u s i n g t h e p e r i o d b e f o r e f o n t a n d q u o t e s a r o u n d
A r i a l . P r e s s t h e E n t e r k e y. A f t e r t h e . f o n t = " A r i a l " l i n e , o n t h e l i n e
b e l o w i n d e n t t w i c e u s i n g t h e t a b k e y a n d t yp e . F o n t S i z e = 1 6 ( n o
quotes but must have the period before .FontSize. Press the Ent er
k e y. O n t h e n e x t l i n e i n d e n t t w i c e u s i n g t h e t a b k e y a n d
t yp e . F o r e C o l o r = v b B l u e ( n o q u o t e s , j u s t t h e p e r i o d b e f o r e
ForeColor. (You are almost through with this control). You will only
i n d e n t o n c e o n t h e n e x t l i n e , u s i n g t h e t a b k e y. T yp e E n d W i t h a n d
press the Enter key. Allow the last line of text for this sub procedure
to read End Sub (no period). You have now coded the entire
cmdHello sub procedure which will place text into the txtHello
control when the program runs, will change the text to a 16 poin t
the mouse over a certain area, and so forth. When a user event
occurs and that object has a sub procedure cod ed for that user event,
then the code will run. The programmer only programs what will
happen "IF" a user event occurs.
The programmer cannot control the user. If I, the user, do not drag
my mouse cursor over some magic area that is programmed, then
nothing will happen even though the programmer went to all that
trouble to write the code for a "mouse over" event. This is what is
meant b y the term "event -driven programming language". (In a
command line program the code would run in sequence, one line
after another, regardless of any user events.)