devxlogo

July 17, 1999

Cross-midnight time measurements

Any time the behavior of your code depends on the Timer function you should take into account the (more or less) remote possibility that your code is executed just before

A VarPtr substitute function for VB4

Both VB5 and VB6 include a hidden function, named VarPtr, that returns the address of a variable. Many advanced tricks and routines, on VB2TheMax or other site, use this function.

Check a GUID

The following routine quickly check that a string contains a valid GUID. Of course, it doesn’t check that the GUID refers to a valid entity, but at least it lets

How to View the Source of External JS Files

You can use an external JS file to store modular JavaScript code. In addition to being modular, it hides your JavaScript code from novice users. However, it is possible for

Get a Hold of Swing Defaults

Swing is one of the best things that happened to Java GUI developers. At the heart of Swing is the javax.swing.UIManager class (com.sun.java.swing.UIManager for Swing 1.03 and below) that keeps

Use Stored Procedures in Place of Embedded SQL

Stored procedures offer many advantages over dynamic SQL, including improved performance and scalability. The SQL code in a stored procedure is parsed and normalized when you create it. Stored procedures

Do Not Use Operator New in a Throw Statement

Dynamic allocation of an exception (as in this example) is not a good idea: class Err{public: Err(const char * description);};void f(){ if (disaster) throw new Err(“failed”); //exception object is dynamically

One More Reason to Avoid Macros

Even macros that look harmless can have detrimental effects. For example: #define twice(x) ((x)+(x)) The macro, twice, is well parenthesized and performs a simple addition operation. Despite its simplicity, there