August 1, 1998

Learn Control Array Bounds

You can use a control array’s UBound and LBound properties to determine how many controls are loaded. This code fills a string with the captions in the Label1 control array:

Right-Justify or Left-Justify Text

Use the Format$ function to produce right- or left-justified text: Format$(123, “@@@@@@”) gives ” 123″Format$(123, “!@@@@@@”) gives “123 “

Close Forms Uniformly

To close forms uniformly, treat the system menu’s Close command and your File menu’s Exit command in the same manner. In your Exit command, simply unload the form. Let the

Create a new Project Template

Upon initialization, the VB5 IDE presents you with a list of project types, such as Standard EXE or ActiveX EXE. You can also create new project types yourself by creating

Multiple Actions on One Event

To put two actions for one onmouseover=” ” event, just separate the two actions with a semicolon just like you would any two JavaScript statements. For example: OnChange=”alert(‘First Action’);alert(‘Second Action’)”

String Objects and C-strings: Caveats

The standard string class has a dual interface: it supports both C-style strings as well as string objects in various operations: const char text[] = “hello world”;string s = text;

Function Overloading

In order to overload a function, a different signature should be used for each overloaded version. A function signature consists of the list of types of its arguments as well

Pre-Defined Macros

All C/C++ compilers define the following macros: __DATE__ //a literal containing the compilation date in the form “Apr 13 1998″__TIME__ //a literal containing the compilation time in the form “10:01:07″__FILE__