Difference between revisions of "Visual Basic"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
 
(link reorg; API-Guide)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
==Navigation==
 +
[[computing]]: [[software]]: [[programming]]: [[Visual Basic]]
 +
==Overview==
 
[[Microsoft]] [[Visual Basic]], often abbreviated "VB", is a computer language and [[IDE (programming)|IDE]]. The latest version is VB6, which seems to be no longer (or minimally) supported; VB6's successor, [[VB.NET]], is apparently a rather different language and not entirely backward-compatible.
 
[[Microsoft]] [[Visual Basic]], often abbreviated "VB", is a computer language and [[IDE (programming)|IDE]]. The latest version is VB6, which seems to be no longer (or minimally) supported; VB6's successor, [[VB.NET]], is apparently a rather different language and not entirely backward-compatible.
==Features==
+
===Features===
* Language
+
* of the Language
 
** Event-driven
 
** Event-driven
 
** Supports object-oriented programming (although it is essentially method-based, and also does not support inheritance)
 
** Supports object-oriented programming (although it is essentially method-based, and also does not support inheritance)
Line 7: Line 10:
 
** Supports required definitions, i.e. the compiler will give an error if you use an undefined variable
 
** Supports required definitions, i.e. the compiler will give an error if you use an undefined variable
 
** Supports variant-type variables which can store any data type
 
** Supports variant-type variables which can store any data type
* IDE
+
* of the [[IDE (programming)|IDE]]
 
**  Function fill-in popups which show:
 
**  Function fill-in popups which show:
 
*** all arguments needed by a function, subroutine, or method
 
*** all arguments needed by a function, subroutine, or method
 
*** which argument you are currently filling in, based on cursor position  
 
*** which argument you are currently filling in, based on cursor position  
 
*** Listing of available fields/methods: on typing the name of an object plus ".", a list of defined fields and methods will pop up  
 
*** Listing of available fields/methods: on typing the name of an object plus ".", a list of defined fields and methods will pop up  
==Pros==
+
===Pros===
 
Good for writing business applications where correct implementation of somewhat complicated logic is more important than speed or elegance of design.
 
Good for writing business applications where correct implementation of somewhat complicated logic is more important than speed or elegance of design.
==Cons==
+
===Cons===
 
Many programmers consider using VB for development to be sort of like eating candy for dinner, for reasons that I can't think of at the moment. It does tend to allow a lot of a programmer's mental muscles to atrophy through inactivity, however.
 
Many programmers consider using VB for development to be sort of like eating candy for dinner, for reasons that I can't think of at the moment. It does tend to allow a lot of a programmer's mental muscles to atrophy through inactivity, however.
  
Line 24: Line 27:
  
 
Place a treeview control on page 1 of an SSTab. Set page 2 as the default. If you want to resize the SSTab to fill the form and resize the treeview to fill the tab, you run into problems because the treeview's location (mainly the "Left" field) isn't set properly until page 1 is displayed, and there doesn't seem to be any systematic way of determining when its location data is correct. The treeview's "visible" property is set True even though it isn't actually visible. (Perhaps the SSTab is setting the Left field to a weird value in order to hide the treeview?)
 
Place a treeview control on page 1 of an SSTab. Set page 2 as the default. If you want to resize the SSTab to fill the form and resize the treeview to fill the tab, you run into problems because the treeview's location (mainly the "Left" field) isn't set properly until page 1 is displayed, and there doesn't seem to be any systematic way of determining when its location data is correct. The treeview's "visible" property is set True even though it isn't actually visible. (Perhaps the SSTab is setting the Left field to a weird value in order to hide the treeview?)
==Reference==
+
==Notes==
 +
* To convert an integer to a [[hexadecimal]] string, you don't look in any of the obvious places (e.g. the [[Format function (VB)|Format function]]); there is a special function called [[Hex (VB function)|Hex]].
 +
* To convert a hexadecimal string back to an integer, use the [[Val function (VB)|Val function]]: '''Val("&H" & <u>strHex</u>)''' where <u>strHex</u> is a variable containing the hexadecimal string to convert.
 +
===ActiveX===
 +
The following applies for properties of classes in "ActiveX EXE" projects, and may be slightly different for "ActiveX DLL" projects:
 +
* '''Private''' means the class is only available within the project, and not externally via the ActiveX interface
 +
* '''PublicNotCreatable'''
 +
* '''SingleUse'''
 +
* '''GlobalSingleUse''' makes all of the class's methods global methods of the project, rather than making the class itself exist as a global
 +
** Common practice: declare a "catch-all" object which creates and initializes the various classes you want on request, and make that object GlobalSingleUse
 +
* '''MultiUse''' means that the calling program may create objects of this class
 +
* '''GlobalMultiUse'''
 +
 
 +
==Related Pages==
 +
* [[User:Woozle/VB libraries]]: some utility classes and modules which can either be used as-is or as examples
 +
==Links==
 +
===Reference===
 
* {{wikipedia|Visual Basic}}
 
* {{wikipedia|Visual Basic}}
 +
===Tools===
 +
* [http://allapi.mentalis.org/agnet/apiguide.shtml API-Guide]
 +
===Non-Technical===
 +
* '''2006-10-02''' [http://www.movingtofreedom.org/2006/10/09/reformation-of-a-visual-basic-programmer/ Reformation of a Visual Basic Programmer] by Scott Carpenter; originally published in ''Free Software Magazine''
 +
* '''2006-09-25''' [http://www.movingtofreedom.org/2006/10/03/confessions-of-a-visual-basic-programmer/ Confessions of a Visual Basic Programmer]  by Scott Carpenter; originally published in ''Free Software Magazine''

Latest revision as of 18:36, 12 July 2007

Navigation

computing: software: programming: Visual Basic

Overview

Microsoft Visual Basic, often abbreviated "VB", is a computer language and IDE. The latest version is VB6, which seems to be no longer (or minimally) supported; VB6's successor, VB.NET, is apparently a rather different language and not entirely backward-compatible.

Features

  • of the Language
    • Event-driven
    • Supports object-oriented programming (although it is essentially method-based, and also does not support inheritance)
    • Unlike older BASIC varieties, does not require line numbers; can use text as labels just as easily
    • Supports required definitions, i.e. the compiler will give an error if you use an undefined variable
    • Supports variant-type variables which can store any data type
  • of the IDE
    • Function fill-in popups which show:
      • all arguments needed by a function, subroutine, or method
      • which argument you are currently filling in, based on cursor position
      • Listing of available fields/methods: on typing the name of an object plus ".", a list of defined fields and methods will pop up

Pros

Good for writing business applications where correct implementation of somewhat complicated logic is more important than speed or elegance of design.

Cons

Many programmers consider using VB for development to be sort of like eating candy for dinner, for reasons that I can't think of at the moment. It does tend to allow a lot of a programmer's mental muscles to atrophy through inactivity, however.

VB is only available for Windows, so cannot be used for cross-platform development.

VB only produces GUI-based applications, and cannot be used to write text console (i.e. DOS mode) applications.

Problems

listed more or less as they come up

Place a treeview control on page 1 of an SSTab. Set page 2 as the default. If you want to resize the SSTab to fill the form and resize the treeview to fill the tab, you run into problems because the treeview's location (mainly the "Left" field) isn't set properly until page 1 is displayed, and there doesn't seem to be any systematic way of determining when its location data is correct. The treeview's "visible" property is set True even though it isn't actually visible. (Perhaps the SSTab is setting the Left field to a weird value in order to hide the treeview?)

Notes

  • To convert an integer to a hexadecimal string, you don't look in any of the obvious places (e.g. the Format function); there is a special function called Hex.
  • To convert a hexadecimal string back to an integer, use the Val function: Val("&H" & strHex) where strHex is a variable containing the hexadecimal string to convert.

ActiveX

The following applies for properties of classes in "ActiveX EXE" projects, and may be slightly different for "ActiveX DLL" projects:

  • Private means the class is only available within the project, and not externally via the ActiveX interface
  • PublicNotCreatable
  • SingleUse
  • GlobalSingleUse makes all of the class's methods global methods of the project, rather than making the class itself exist as a global
    • Common practice: declare a "catch-all" object which creates and initializes the various classes you want on request, and make that object GlobalSingleUse
  • MultiUse means that the calling program may create objects of this class
  • GlobalMultiUse

Related Pages

Links

Reference

Tools

Non-Technical