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
(reorg; Woozle's libraries)
(→‎Notes: hex to decimal)
Line 31: Line 31:
 
==Notes==
 
==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 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, you have to write your own conversion routine (as far as I can tell).
+
* 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.
 +
 
 
==Related Pages==
 
==Related Pages==
 
* [[User:Woozle/VB libraries]]: some utility classes and modules which can either be used as-is or as examples
 
* [[User:Woozle/VB libraries]]: some utility classes and modules which can either be used as-is or as examples

Revision as of 17:38, 2 January 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.

Reference

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.

Related Pages

Links