Information AboutVisual Basic |
Visual Basic ('''VB''') is an Event Driven Programming Language and associated Development Environment from Microsoft for its COM programming model. VB has been deprecated in favor of Visual Basic .NET , although conversion from VB to VB .NET can be non-trivial. {Link without Title} .) Visual Basic was derived from BASIC and enables the Rapid Application Development (RAD) of Graphical User Interface (GUI) applications, access to Database s using DAO , RDO , or ADO , and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently. For example: S="ABC" : S = S & "DEF" : S = S & "GHI" is common practice in VB, but will cause major problems if used on ASP pages. This is because strings are handled differently by the two languages. The above code will cause significant overhead for VBScript.A programmer can put together an application using the Components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API , but doing so requires external function declarations. In business programming, Visual Basic has one of the largest user bases. In a survey conducted in 2005, 62% of developers reported using some form of Visual Basic, it currently competes with C++ , JavaScript , C# and Java for dominance in the business world.http://www.computerworld.com/developmenttopics/development/story/0,10801,100542,00.html LANGUAGE FEATURES Visual Basic was designed to be easy to learn and use. The language not only allows programmers to easily create simple GUI applications, but also has the flexibility to develop fairly complex applications as well. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of Code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue. Although programs can be compiled into native code executables From Version 5 Onwards , they still require the presence of runtime libraries of approximately 2 MB in size. This runtime is included by default in Windows 2000 and later, but for earlier versions of Windows it must be distributed together with the executable. Forms are created using Drag And Drop techniques. A tool is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have Attribute s and Event Handler s associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for a keypress in a text box, the program can automatically translate the case of the text being entered, or even prevent certain characters from being inserted. Visual Basic can create executables (EXE files), ActiveX Controls , DLL files, but is primarily used to develop Windows applications and to interface web database systems. Dialog boxes with less functionality (e.g., no maximize/minimize control) can be used to provide pop-up capabilities. Controls provide the basic functionality of the application, while programmers can insert additional logic within the appropriate event handlers. For example, a drop-down combination box will automatically display its list and allow the user to select any element. An event handler is called when an item is selected, which can then execute additional code created by the programmer to perform some action based on which element was selected, such as populating a related list. Alternatively, a Visual Basic component can have no user interface, and instead provide ActiveX objects to other programs via Component Object Model (COM). This allows for Server-side processing or an add-in module. The language is Garbage Collected using Reference Counting , has a large library of utility objects, and has basic Object Oriented Support . Since the more common components are included in the default project template, the programmer seldom needs to specify additional libraries. Unlike many other programming languages, Visual Basic is generally not case sensitive, although it will transform Keywords into a standard case configuration and force the case of variable names to conform to the case of the entry within the symbol table entry. String comparisons are case sensitive by default, but can be made case insensitive if so desired. The Visual Basic compiler is shared with other Visual Studio languages (C, C++), but restrictions in the IDE do not allow the creation of some targets (Windows model DLL's) and threading models. CHARACTERISTICS PRESENT IN VISUAL BASIC Visual Basic has the following uncommon traits:
: OPTION BASE was introduced by ANSI, with the standard for ANSI Minimal BASIC in the late 1970s. The extension to using a form of DIM A(1976 TO 2020) was first introduced in BBC Basic , found on the BBC Micro , which in turn was influenced by COMAL .
PROGRAMMING CONSTRUCTS NOT PRESENT IN VISUAL BASIC Many of these features are implemented in Microsoft's replacement for Visual Basic 6 and prior, VB.NET .
While Visual Basic does not naturally support these features, programmers can construct work-arounds to give their programs similar functionality if they desire. EVOLUTION OF VISUAL BASIC VB 1.0 was introduced in 1991 . The approach for connecting the programming language to the graphical user interface is derived from a prototype developed by Alan Cooper called ''Tripod''. Microsoft contracted with Cooper and his associates to develop Tripod into a programmable shell for Windows 3.0, under the code name ''Ruby'' (no relation to the Ruby Programming Language ). Tripod did not include a programming language at all, and Ruby contained only a rudimentary command processor sufficient for its role as a Windows shell. Microsoft decided to use the simple Program Manager shell for Windows 3.0 instead of Ruby, and combine Ruby with the Basic language to create Visual Basic. Ruby provided the "visual" part of Visual Basic — the form designer and editing tools — along with the ability to load Dynamic Link Libraries containing additional controls (then called "gizmos"). Ruby's extensible gizmos later became the VBX interface. Timeline of Visual Basic (VB1 to VB6)
DERIVATIVE LANGUAGES Microsoft has developed derivatives of Visual Basic for use in Scripting . It is derived heavily from BASIC and host Applications , and has replaced the original Visual Basic language with a .NET platform version:
SAMPLE CODE Here are some examples of the language: Function that returns the area of a circle: Private Function AreaOfCircle(Radius As Double) As Double Const PI = 3.14159265358979323846264
End Function Program to display a pop-up window with the words "Hello World" on it: Private Sub Form_Load() MsgBox "Hello World" End Sub A program that prints "Hello World" to the form each time a button is pressed. Private Sub Command1_Click() Print "Hello World" End Sub REFERENCES SEE ALSO
EXTERNAL LINKS
''' |
|
|