May 12, 1999

Double-Click to Create Skeleton Event Handlers in Visual InterDev 6

There’s a handy shortcut in Visual InterDev 6 that saves you from typing in the function code around an event. While you are in VID’s Source view, click the Script Outline tab and locate the object for which you need an event handler. Expand the object’s node and then double-click

Optimize With the Named Return Value

The named return value is an automatic optimization that a compiler applies in order to eliminate the construction and destruction of a temporary object. When a temporary object is copied to another object using a copy constructor, and none of these objects is const or volatile, the Standard allows the

Limit the Number of Rows Returned When Using JDBC

If you’re issuing SELECT statements to a database using Java Database Connectivity (JDBC), a huge number of records can be returned by the java.sql.ResultSet. However, sometimes you will want to limit the number of records returned. Java provides a simple mechanism for doing this: simply call the setMaxRows() method defined

Dynamically Load a Style Sheet

Question: How do you dynamically load a style sheet? I’m trying to use the tag in the to load a style sheet. All the pages in my site use the same so I get a uniform appearance throughout. I want to let users choose which style sheet to use, with

Subclass Grid Controls

Sometimes a class needs to communicate with the object that created it. For example, I use a class to subclass grid controls so I can handle things such as tabbing between columns and unbound population automatically. The class has a SubclassGrid method that makes the subclassing mechanism work, and at

Use Select Case to Evaluate Different Expressions

Select Case is commonly used to check different values of a specific variable or expression. You can also use Select Case to evaluate multiple expressions, by starting out with “Select Case True” and listing each expression as a separate “Case”: Select Case True Case Option1(0).Value ‘Do something Case Option1(1).Value ‘Do

Compare Floating Point Values Using the Round Function

When you have to compare the results of floating point expressions, you can’t rely on the “=” operator due to the finite precision of Single or Double variables. To see this concept demonstrated, use this code: Dim i As Integer, d As DoubleFor i = 1 To 10 d =

Join Two Files Together

The DOS Copy command allows you to take the contents of two different files and put them one after the other into a third file. You can do the same thing in VB with this subroutine: Public Sub JoinFiles(Source1 As String, Source2 As String, _ Dest As String) Dim Buffer()

Cache Your JavaScript Object References

You can write JavaScript code that is more readable and maintainable by reducing object references. For instance, you can use the with() statement or nested with() statements in JavaScript to shorten object references (see Tip: “Make Your JavaScript Code More Readable Using with()”). If you find that technique confusing, another

No more posts to show