Visual Basic Classic

from Wikipedia, the free encyclopedia
Visual Basic Classic
Paradigms : procedural, object and event-
oriented
Publishing year: 1991
Developer: Microsoft Corp.
Current  version : 6.0   (1998)
Typing : strong, static, implicit and explicit (only explicit on request)
Important implementations : Microsoft Visual Basic
Dialects: VBA , VBScript
Influenced by: QuickBASIC
Affected: Gambas
Operating system : Windows
MS-DOS (version 1 only)
License : proprietary
msdn.microsoft.com/en-us/library/windows/desktop/ms788229.aspx

Visual Basic Classic [ ˈvɪʒʊəl ˈbeɪsɪk ] (abbr. VB ) is a proprietary object-oriented programming language . In order to differentiate between the old, only object-based, and the new versions based on the .NET framework, the former up to and including Visual Basic 6.0 are referred to as Visual Basic Classic , the latter, however, as Visual Basic .NET ( abbr.VB.NET ) designated. This article covers Visual Basic Classic.

introduction

The historically most important advantage of BASIC is that it is easy to learn the language. The language is deliberately based on the English language and uses words instead of symbols. Examples are And instead of && , Or instead of || , Mod instead of % , as usual in C ++ .

Since Visual Basic was designed from the start for use with an integrated development environment , Visual Basic programs can usually be created in a short time. This makes it suitable for rapid application development . The specialty was the graphic creation of program interfaces, which at the time of publication was only offered by a few programming environments.

Visual Basic is considered to be very well documented. The MSDN Library is one of the largest collections of information for programmers (delivery on three CDs / 1 DVD).

Visual Basic supports both static and dynamic typing using the " Variant " data type.

history

In the early 1990s, BASIC , which was then supplied with many operating systems, had lost its importance compared to other high-level languages ​​such as C and C ++ . BASIC offered much more limited functionality and expandability, making it unsuitable for professional use.

The later historical success of Visual Basic is primarily based on the ease of learning, visual development environments and the uncomplicated expandability of the associated program libraries . Critics criticize the poor functionality. Often there is also talk of slow execution speeds on inefficient computers (mostly only during the interpretation ), which is now negligible on modern computers after translation .

1991: Visual Basic 1 and Visual Basic for DOS - The Beginnings

The Shape Designer in Visual Basic for MS-DOS

The company Microsoft , whose history with the development of a BASIC interpreter began, joined in 1991 their QuickBasic compiler with an environment for interactive design of user interfaces . This environment, which goes back to Alan Cooper (sometimes referred to as the "father" of Visual Basic), made it possible for the first time to create applications for Windows quickly and easily .

The source code of Visual Basic 1 programs was interpreted , that is, the source code was processed during execution (i.e. at runtime ). The program files ( EXE files) generated with the translation did not contain any directly executable machine code, but so-called P code . A separate runtime library therefore always had to be supplied for execution . This also applies to versions 5 and 6 of Visual Basic, which can generate native code.

IDE from VBDOS
VBDOS help file

Visual Basic for Windows came before Visual Basic for MS-DOS ("VBDOS") on the market. VBDOS was based more strongly on its predecessors Microsoft BASIC PDS and QuickBASIC and could process the corresponding source code immediately. VBDOS creates programs for running under DOS (and also independently executable files without an additional runtime library), but not Windows programs. While the Windows version of Visual Basic had a graphical user interface and could also display bitmaps, VBDOS ran in text mode and simulated a quasi-graphical user interface from ASCII characters. VBDOS was not as successful as the version for Windows, so there was never a successor version.

With Visual Basic the strategy of different executions was introduced. Before that, QuickBASIC corresponded to the “Standard Edition” and BASIC PDS to the “Professional Edition” . Sample programs were included that demonstrated, for example, the integration of a help system, the support of Windows fonts and the use of presentation graphics.

1992–1993: Visual Basic 2–3 - Integration of the development process

With the follow-up versions "Visual Basic 2" (1992) and "Visual Basic 3" (1993), which only appeared under Windows, extensions to the language and the development environment were implemented. Among other things, objects were introduced. As of Visual Basic 2, so-called additional controls of the type VBX (Visual Basic Extensions) were also supported, with which third-party manufacturers or other C programmers could expand the functionality of Visual Basic and which were an important factor in the success of Visual Basic.

1996–1998: Visual Basic 4-6 - 32 bit and COM

Visual Basic 4, which was published after a long break in 1996, was not only available in a 16-bit version for Windows systems up to version 3.1, but also as a 32-bit version that was used for Windows NT and Windows 95 could create optimized programs. The jump from 16 to 32 bits was followed by the next big innovation in the following year: Visual Basic 5 programs were compiled in machine code for the first time . In contrast to the previous versions, it was no longer possible to extract the source code of Visual Basic programs from the executable file. There was also a significant gain in performance . The increase in speed was mainly bought through unsafe optimizations, recognizable by the often different behavior of the programs compiled in machine code. These innovations made Visual Basic 5 suitable for the first time for creating time-critical applications. Even so, Visual Basic programs were still slower than, say, C ++ programs.

With Visual Basic 4, 5 and 6 (1998) object-oriented elements were added to the language, but without meeting all the criteria of object-oriented programming . Visual Basic 6 was the last Visual Basic version that made it possible to create native Win32 programs.

Visual Basic 4 expanded the concept of “Standard Edition” and “Professional Edition” to include the “Enterprise Edition” . With Visual Basic 5, a "Control Creation Edition" (CCE) was also published, which was free of charge, but could only be used to create control elements (ActiveX controls, OCX).

Embedded Visual Basic (EVB)

For the development of Windows Mobile / Windows CE applications there was a special version called Embedded Visual Basic. It was very similar to the classic VB and was discontinued with the appearance of VB.NET. The required runtime library was part of the operating system until Windows Mobile 2003; later it could be installed separately.

Offshoot

Because of its popularity and ease of learning, Microsoft has adapted Visual Basic Classic for various specific environments.

Visual Basic Script

Visual Basic Script ( VBScript or VBS for short ) is an interpreted version of Visual Basic that is used to create dynamic websites or smaller scripts. The language uses the same syntax as Visual Basic Classic. Surfaces cannot be created directly, but only indirectly by embedding the VBScript code in HTML using the Windows Scripting Host . VBS can access all COM objects with an IDispatch interface. In addition to Windows and client-side web scripts, VBS was also used for server-side web scripts in an ASP environment. With ASP.NET , however, VBS was replaced by VB.NET.

Visual Basic for Applications

Visual Basic for Applications ( VBA for short ) is also an interpreted scripting language based on Visual Basic Classic. It was specifically for automating repetitive tasks within other programs developed and has gained wide popularity since Microsoft does with its office productivity Office delivers. Microsoft Excel, Microsoft Access (both since 1995) and Microsoft Word (since 1997) have the oldest VBA connections. VBA also competes with .NET, since Visual Studio .NET is shipped with Visual Studio Tools for Applications (formerly Visual Studio Tools for Office ), which perform a similar function to VBA.

Development environments

The (historically determined) most popular integrated development environment for Visual Basic is "Microsoft Visual Basic", to which there was no alternative.

Syntax example

The syntax of Visual Basic Classic is based on its predecessor, QuickBASIC . This Hello World program contains the start function Main of the program. The MsgBox command creates the message box .

Sub Main()
    MsgBox "Hallo Welt!"
End Sub

Legal Aspects

Unlike many modern high-level languages, Visual Basic Classic is not an open standard, but is proprietary and intellectual property of Microsoft .

Web links

Individual evidence

  1. VB variable types ( Memento from December 10, 2013 in the Internet Archive )
  2. From QBasic to VBDOS / VBWIN