devxlogo

Tip Bank

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

Do You Know About Date Literals?

Using a Date literal is about 12 times faster-according to NuMega TrueTime-than using the CDate function and converting a string literal. Here’s an example: Dim TestDate as Date ‘The following

Perform Look-Ahead Typing

This subroutine lets the user perform look-ahead typing, as in Netscape Navigator, Microsoft Internet Explorer, and other apps. The sub takes an array of strings and a TextBox control as

Use Brackets to Keep VID 6 Happy

When you use the Scripting Object Model (SOM) in Visual InterDev 6, keep in mind that the script library is biased towards JavaScript. Your perfectly valid VBScript may produce strange

Pass Data Between Threads Using Piped Streams

Java simplifies I/O by providing a rich library of classes that support stream interfaces. Among these classes, the combination of PipedInputStream and PipedOutputtStream closely resembles a UNIX system “pipe.” The