About Visual Basic – basic things

Visual Basic is a programming language developed by Alan Cooper for Microsoft. The programming language is a dialect of BASIC, with major additions. Its first version was introduced in 1991 with the intent to simplify programming using a fully graphical development environment to facilitate the creation of graphical interfaces and to some extent also the same programming. In 2001, Microsoft intends to abandon development based on the Win32 API and proceed to work on a common framework or context of independent bookstores version of the operating system. NET Framework, through Visual Basic. NET (and other languages such as C – Sharp (C #) easy transition code between them) that presents serious incompatibilities with existing Visual Basic code.

Visual Basic is an IDE (integrated development environment or in English Integrated Development Environment) that has been packaged as an application program, that is, consists of a code editor (program where you write the source), a debugger (programme correcting errors in the source code so that it can be either compiled), a compiler (program that translates the source code to machine code), builder and a graphical user interface or GUI (is a form of programming in which it is not necessary write code for the graphic program, but that can be done visually).

General Characteristics

It is easily accessible language learning designed for both beginners and expert programmers, guided by events, and working on a forms engine that facilitates the rapid development of graphics applications. His syntax derived from the old BASIC, has been expanded over time to add the typical characteristics of modern languages structured. It has added a limited implementation of object-oriented programming (the actual forms and controls are objects), although it admits polymorphism using the interfaces, does not support inheritance. It does not require management pointers and has a very simple handling of strings. It has several libraries for database management, being able to connect to any database through ODBC (Informix, DBase, Access, MySQL, SQL Server, PostgreSQL, etc.) through ADO.

It is used mainly for business management applications because of the speed with which a program can be done using a simple database, in addition to the abundance of programmers in this language.

The Microsoft compiler generates executable requiring a DLL to function, sometimes called MSVBVMxy.DLL (acronym for “Microsoft Visual Basic Virtual Machine xy”, being xy version) and other VBRUNXXX.DLL ( “Visual Basic Runtime X . XX “), which provides all the functions implemented in the language. In addition there are a large number of libraries (DLL) that facilitate access to many features of the operating system and integration with other applications. But this is only a limitation on systems obsolete, since libraries necessary to run programs in Visual Basic come as standard on all versions of Windows since Windows 2000.

Versions

Versions of Visual Basic for Windows are well known, but there is a version of Microsoft Visual Basic 1.0 for MS-DOS (Standard and Professional editions) less widespread and dating back to 1992. It was an environment that, although text mode, including a form designer which could drag and drop individual controls.

The latest version only for 16 bit, 3.0, contain a detailed library of components for all uses. During the transition from Windows 3.11 to Windows 95, appeared version 4.0, which could generate 16 programs and 32-bit from the same source, at the expense of a large increase in the size of files “runtime” necessary. In addition, VBX controls are replaced by new OCX. With version 5.0, was implemented for the first time the possibility of compiling a native code, obtaining a considerable improvement in performance. Both this and the subsequent 6.0 bear characteristics of object-oriented languages, but lacks some important items such as inheritance, polymorphism and overloading. Version 6.0 is still used massively.

The current versions of Visual Basic are based on the platform. NET. Version 7 of the language was implemented by Microsoft in Visual Basic. NET. Visual Basic. NET 2003 brought version 7.1, while the version 8 was implemented in Visual Basic 2005. Visual Basic 2008 amounted to version 9. These versions have many of the characteristics of the original language, but also many differences. In many instances to carry a code written in Visual Basic 6 and Visual Basic. Net is necessary to rewrite the code. The new version of the language is mostly equivalent to C # but has some differences. So there is a debate on the validity of this new version of the language and its advantages and disadvantages on C #.

Advantages and disadvantages

Advantages

* Ease of language allows you to create applications for Windows in a very short time. In other words, it enables effective development and investment in less time than with other languages.
* Allows generate dynamic libraries (DLL) ActiveX natively and Win32 (not ActiveX, COM interface) through a reconfiguration of its linker in the compilation process.
* Allows the use of forms (Forms) both from resources (as in other languages) as using an IDE to design them.
* Ability to develop and run applications of Visual Basic 6.0 under Windows Vista without making changes in most cases but is not achieved to maximize the characteristics of this system as doing so allows Visual Basic 2005 or Visual Basic 2008.
* Existence of a free development environment called Visual Basic Express Edition. [1]

Disadvantages

* Without support from Microsoft since April 4, 2008.
* It’s proprietary software by Microsoft, therefore no one other than the development team of this company decides on the evolution of language.
* There is no way to export the code to other platforms other than Windows.
* The executable generated are relatively slow in Visual Basic 6.0 and earlier pseudo-code to be interpreted.
* By default allows programming without a declaration of variables. (which can be corrected simply by typing the phrase Option Explicit in the header of each form, in which case it will be necessary to declare all variables to use, so you end generates code purest).
* His syntax is not case sensitive (not case insensitive like C + + for example)
* Do not allow low-level programming or incrustrar sections of code in ASM.
* Only allows the use of functions of dynamic libraries (DLL) stdcall.
* Strong dependence on libraries and components in versions 6.0 and earlier, which hampered the distribution of developments between machines.
* Some features are undocumented.
* The poor implementation of POO in Visual Basic 6.0 and earlier does not take full advantage of this programming model.
* It does not support treating processes as part of language.
* The handling errors that have by mistake on the order does not follow the patterns structured.
* Does not include travel operators as part of bits of language.
* Do not allow dynamic memory management, pointers, and so on. as part of language.
* Not warns of certain errors or warnings (the compiler can be configured to generate executable without controllers integer overflow checks or limits on parent among others, thus leaving more than hand the developer the task of controlling such errors)
* The treatment is basic Windows messages and indirect.
* The vast range of controls are incorporated, however, in some cases, very general, which leads to having to reschedule new controls for a specific need of implementation. This radically changes in Visual Basic. NET where it is possible to reschedule or reuse and improve existing controls.
* The custom controls do not improve the power of the Windows API, and in some cases resort to it will be the only way to achieve the desired custom control.

Neighborhood development

There are two development environments for Visual Basic IDE:

* Microsoft Visual Basic for X.0 versions from 1.0 through 6.0, (with the differences between the versions from 1.0 (MS-DOS/Windows 3.1) to 3.0 (16-bit, Windows 3.1) and the 4.0 ( 16/32 bit Windows 3.1/95/NT) to 6.0 (32-bit, Windows 9x/Me/NT/2000/XP/Vista)
* Microsoft Visual Studio. NET integrated environment for several languages including Visual Basic. NET (32/64 Bit, Windows XP / Vista), with editions:
Express or (more limited but free tools)
Standard or
or Professional (business licence)
or Team Edition (Much more comprehensive tools to more expensive commercial license)
* There are alternatives to free as SharpDevelop. NET and Mono Project.

Compilers

Given the nature of language, the compiler is par excellence Microsoft Visual Basic which in turn is an IDE for language but there are many other IDEs and compilers including

* Prawns – SDI + Compiler Systems: Linux editions: Free
* PureBasic – SDI + Compiler Systems: Win32, Linux, Mac, Amiga Editions: evaluation and commercial
* PowerBasic – SDI + Compiler Systems: DOS, Win32 issues: trade
* RealBasic – SDI + Compiler Systems: Win32, Linux, Mac Publishing: evaluation and commercial (Standard and Proffesional)
* BlitzPlus – SDI + Compiler, development-oriented 2D graphics under Windows editions: evaluation and commercial
* Blitz3D – SDI + Compiler, development-oriented 2D and 3D games under Windows editions: evaluation and commercial
* BlitzMax – SDI + Compiler, development-oriented games 2D, extendable to 3D Systems: Windows, Linux and Mac OS editions: evaluation and commercial

Example: Vb 6.0, How to make a simple calculator

Before you start typing the code should be placed in a new form three boxes of text (Textbox) aligned horizontally as well as four buttons (CommandButton).

Here is a screenshot of how quedaria form created:

[[1]]

Once done, go to code and write:

A Dim As Long
As Long Dim B
Private Sub Form_Load ()
‘This makes the text boxes are cleaned and placed the box does not change the outcome.
Text1.text = “”
Text2.text = “”
Text3.text = “”
Text3.locked = True
‘This gives signs of the operation CommandButton.
Command1.Caption = “+”
Command2.Caption = “-”
Command3.Caption = “*”
Command4.Caption = “/”
End Sub
‘The next four Private Subs state that the press each button to execute the operation and show the result in the box and locked.
Private Sub Command1_Click ()
A = text1.text
B = text2.text
text3.text = A + B
If text1.text = “” Then
MsgBox “do the impossible sum for lack of a value”, vbInformation
Else
If text2.text = “” Then
MsgBox “do the impossible sum for lack of a value”, vbInformation
End If
End If
End Sub
Private Sub Command2_Click ()
A = text1.text
B = text2.text
text3.text = A – B
If text1.text = “” Then
MsgBox “impossible to do the rest for lack of a value”, vbInformation
Else
If text2.text = “” Then
MsgBox “impossible to do the rest for lack of a value”, vbInformation
End If
End If
End Sub
Private Sub Command3_Click ()
A = text1.text
B = text2.text
text3.text = A * B
If text1.text = “” Then
MsgBox “impossible for lack of multiplying factor”, vbInformation
Else
If text2.text = “” Then
MsgBox “impossible for lack of multiplying factor”, vbInformation
End If
End If
End Sub
Private Sub Command4_Click ()
A = text1.text
B = text2.text
text3.text = A / B
If text1.text = “” Then
MsgBox “impossible to make the division for lack of a value”, vbInformation
Else
If text2.text = “” Then
MsgBox “impossible to make the division for lack of a value”, vbInformation
Else
If text1.text = “0″ Then
MsgBox “impossible divide between zero”, vbInformation
Else
If text2.text = “0″ Then
MsgBox “impossible divide between zero”, vbInformation
End If
End If
End If
End If
End Sub
‘End of code

What they need is to add these blocks of code “If” If the value is a conditional considered in the VB as a fundamental part, since the laid down conditions for how a part of the program.

In this case, calculator, we have put conditions, if text boxes where values are written are empty, we send an error without going into cleansing (process of verification of our code), ie calculator only bring us the error and leave us to amend it, and in the case of division, which can not be divided between 0 an amount, we have done that mark again this mistake, noting that “You can not divide between zero.”

It is a good example of mathematical operands and conditions, should not be able to fulfil them.