March 27, 1999

Regular Expressions in JavaScript 1.2

One of the most powerful new features of JavaScript 1.2 is a set of objects and methods to provide regular expression functionality. Perl programmers have relied on regular expressions for

Propagate User Exceptions

In Java, you can propagate checked exceptions up a class hierarchy in two ways. First, you can declare the exception in the “throws” clause of the enclosing method. Second, you

Avoid Improper Inheritance

Using public inheritance with two classes that do not fully comply with the is-a relation (although they are related to one another) is a common design mistake. For example, deriving

Beware of Using setjmp and longjmp

Using a longjmp() in C++ is dangerous because it jumps out of a function, without unwinding the stack first. Consequently, destructors of local objects are not invoked. As a rule,

Is the Array Dimensioned?

Use this function to determine whether a dynamic array has been dimensioned. I use dynamic arrays to store small, foreign key tables locally for fast lookups. Not wanting to load

Quick Check on Collection Key

You might need to determine whether a certain key is in a collection. The Collection object doesn’t provide a method to retrieve a key after you add an object to

Set the Width of a ListView Column

The ListView Windows control has some additional features that haven’t been exposed in the OCX provided with VB. One feature can shrink or enlarge columns automatically to ensure that data

Keep Track of Global Variables

Forgetting the names of global variables is easy to do. You can solve this problem by letting VB remember the variables for you by making the variables into fields of