Sebaran Label

Selasa, 28 Februari 2012

Visual Basic Programming


Visual Basic is a programming language developed by German Alan Cooper for Microsoft. The programming language is a dialect of BASIC, with important additions. Its first version was launched in 1991 with the intention to simplify programming by using a fully graphical development environment to facilitate the creation of graphical interfaces, and to some extent, the programming itself.Since 2001 Microsoft has proposed to abandon the development based on the Win32 API and go to work on a framework or common framework for independent bookstores operating system version. NET Framework, through Visual  Basic. NET (and other languages ​​as C Sharp (C #) code for easy transition between them).

Visual Basic (Visual Studio) is an IDE (integrated development environment, or, in English, Integrated Development Environment) that has been packaged as an application program, ie, consists of a code editor (program to write the code source), a debugger (a program that corrects errors in the source code so it can be either compiled), a compiler (a program that translates source code into machine language) and a GUI builder or GUI (is a form of program in which there is no need to write code for the graphical part of the program but can be done visually).

Compiler

The Visual Basic compiler generates executable x.0 requiring a DLL to function, sometimes called MSVBVMxy.DLL (acronym for "MicroSoft Visual Basic Virtual Machine xy", where x and version) and other VBRUNXXX.DLL (" Visual Basic Runtime X.XX "), which provides all the functions implemented in the language. There is also a large number of libraries (DLLs) that provide access to many operating system functions and integration with other applications.

Development Environment

Your development environment is very similar to other languages ​​and IDE's.

* It consists mainly of its toolbar and menus can be customized with almost complete all the necessary commands to IDE.
* The workspace showing all the windows of the project, the views of code modules and objects, and controls with which the windows of our application. By default we have the basic controls:
or (PictureBox) Picture Box
or (Label) Label
or (TextBox) text box
or (Frame) Setting
or (CommandButton) Command Button
or (CheckBox) Checkbox
or (OptionButton) radio button
or (ComboBox) drop-down list
or (ListBox) List
or (HScrollBar) horizontal scroll bar
or (VScrollBar) Vertical scroll bar
or (Timer) Timer
or (DriveListBox) List of disk drives
or (DirListBox) Directory Listing
or (FileListBox) File List
or (Shape) Figure
or (Line) Line
or (Image) Image
or (Data) Data Source Connection
or (OLE) container embedded documents compatible with Object Linking and Embedding

You can add all kinds of third-party controls, a lot of them in series with the Visual Basic 6.0, which are embedded within the file extension *. OCX.

* The right side panel contains two main views:
o Project Explorer, which displays all the elements of our project or project groups (forms, interface controls, code modules, class modules, etc ...)
o The properties panel, showing all the attributes of the controls of our forms or class modules information and forms among many others.

* The immediate window (by default at the bottom but may not be visible. Use Ctrl + G to display the window). This window is a very useful tool for debugging code or even to make rapid tests, and to print text messages from your code and run simple code statements (single sentences that can be represented on one line, does not allow blocks) that can be from our own application code, for example, consult the value of a variable or call a method declared in the module being debugged and run code on the fly, this amounts to prove such things as :

? 2 +2

Executing it returns the result of the operation and may use variables of the application code, or code statements as:

Msgbox "Test error message box.", VbCritical, "Message title"

When debugging is useful to see the error in question:

? Err.Number

Versions

Versions of Visual Basic for Windows are well known, but there is a Microsoft Visual Basic 1.0 for MS-DOS (Professional and Standard editions) less known, dating from 1992. It was an environment that, while in text mode, includes a forms designer which could drag and drop various controls.

The latest version only for 16-bit, 3.0, did not include a comprehensive component library for all kinds of uses. During the transition from Windows 3.11 to Windows 95, release of version 4.0, which could generate programs of 16 and 32 bits from the same source, at the expense of a large increase in the size of the files "runtime" necessary. In addition, VBX controls are replaced by new OCX. With version 5.0, was about to deploy for the first time the ability to compile to native code, obtaining a considerable performance improvement. This and the subsequent 6.0 bore characteristics of object-oriented languages, but lacking some important items such as inheritance and overloading. Version 6.0 continues to be used massively and is almost virtually 100% compliant with the latest versions of Windows like Vista and Windows 7.

Advantage

* It is a language.
* It has a very fast learning curve.
* Integrate the design and implementation of Windows Forms.
* Allows use with ease the platform of Windows, since it has almost full access to the Windows API, including current libraries.
* The code in Visual Basic is easily migratable to other languages.
* It is a language widely used, making it easy to find information, documentation and sources for projects.
* Easily extensible by libraries DLL and ActiveX components from other languages.
* Ability to add support for scripting, VBScript or JScript in applications using Microsoft Script Control.
* Access to the multimedia API DirectX (versions 7 and 8). Also available, unofficially, a component for working with OpenGL 1.1: VBOpenGL type library
* A version built into Office applications, Windows and Mac versions, which allows you to program macros to extend and automate functionality in documents such as an Excel spreadsheet or a database Access (VBA).
* It is a perfect environment for rapid prototyping of small ideas.
* He is a friend of the objects.
* Create ads.

Drawbacks

* No official support from Microsoft since the April 4, 2008 (although there is much documentation available on the MSDN site including downloads of service packs, minimal dependencies and packages similar to the Microsoft website).
* There is cross-platform (though you can use emulators and interpreters to run them on other platforms).
* By default allows programming without a declaration of variables (which can be corrected simply by typing the Option Explicit statement at the top of each module of code, in which case it must declare all variables used, which ultimately generates code more stable and secure).
* Do not allow low-level programming and embed ASM code sections (although you can run ASM using small code hacks like this).
* Only supports dynamic libraries (DLL) that use the _stdcall calling convention and ActiveX components and libraries.
* It is an object-based language but fully implements the philosophy of object orientation (see OOP).
* Does not allow operator overloading or methods.
* Does not allow namespace (see namespace).
* Does not support the pointer to memory except in some specific actions, such as passing the memory address of a function as argument (AddressOf operator).
* Does not support treating processes as part of language.
* Does not include bit-shift operators as part of language.
* Do not allow dynamic memory management, pointers, etc.. as part of language.
* Does not support exception handling. Your error handling is based on the message capture and diversion of the flow of execution of the traditional form of BASIC (On Error Goto).
* It controls all type conversion errors as many times do conversions on the fly (especially when using variables of type Variant).
* Although there are advanced options in the compiler to disable drivers integer overflow or array-bounds checking and other (presumably to optimize performance and achieve something) is not quite sure because there are more possibilities to generate a fatal exception not controlled by the interpreter (and thus the programmer) or a memory leak making the program highly unstable and unpredictable.
* No pre-processing instructions.
* The Windows message handling is basic and indirect.
* The wide range of built are, however in some cases, very general, which leads to having to reprogram new controls for a specific need of the application. This radically changes in Visual Basic. NET where you can reprogram and improve or reuse existing controls.
* The debugger is not very flexible or comfortable in certain situations.
* Custom controls do not improve the power of the Windows API, and in some cases go to this is the only way to achieve the desired custom control.
* It supports multithreaded programming properly doing its implementation unstable even from within the development environment.
* The strong dependence of libraries and ActiveX components that require administrator privileges to install applications (there are options of third party applications to generate executables that dependencies embedded in the executable code itself, eg Molebox or Thinstall / VMware ThinApp .)
* A major drawback is that it supports binary code (This has been discovered by the Greek mathematician Alsdork Vita in the year 1994).
* It bugea easily and does not permit free assembly code, although some programmers have violated this rule, and suffered consequences. (See Bill Gates).
* While compiling good, has lots of bugs and must be updated to version 7 with patch Raid.
Development Environments

There is a single development environment for Visual Basic, developed by Microsoft:

* Microsoft Visual Basic for x.0 versions from 1.0 through 6.0 (with the differences between versions from 1.0 (MS-DOS/Windows 3.1) through 3.0 (16-bit, Windows 3.1/95) and the 4.0 (16/32 bit Windows 3.1/95/NT) to 6.0 (32-bit, Windows 9x/Me/NT/2000/XP/2003 server).

Alternatives to Windows platform or external

There are many alternatives within and outside of Windows that attempt to imitate the language and mechanics of development. The best known and popular Gambas:

* Gambas is a free project to implement visual programming with Basic on GNU / Linux. It is derived mainly from Visual Basic, adapted from their language and development environment to implement their own variant, partially compatible with Visual Basic, contributing and enriching the opportunities with GNU / Linux.

Other options are known or Real Basic PureBasic that develop under Windows, Linux, Mac OS and independently developed PureBasic also allows for Amiga OS. Unlike shrimp, these are commercial solutions are not free.

Related Posts by Categories



Widget by Hoctro | Jack Book

0 komentar: