devxlogo

Tip Bank

Overloading a Function Template

If the function template you’re adding incorporates functionality that you already have, then you need to remove the old members first; otherwise the duplication will cause ambiguity. Here’s an example.

Use This Method to Format an Integer

Say you want the length of an integer to be exactly five digits, you can use the below method: NumberFormat nf=NumberFormat.getInstance(); // Get Instance of NumberFormatnf.setMinimumIntegerDigits(5); // The minimum Digits

Export HTML Data into Excel Files

Nowadays, many reports are generated as HTML documents for access on the Web. This tip shows you how to export that HTML data as it is (including all the CSS

Accept Multiple Arrays as Parameters

Passing multi-dimensional arrays to routines is different in VB.NET. Say you have a two-dimensional array called aStrMy2DArray(10,1) as a string data type: Private Sub MyRoutine(ByVal aStrMy2DArray as String (,)) ‘

Execute a .jar File Without All the Usual Debugging

In order to execute a .jar file using Java’s -jar jarfile command, the manifest file needs to have the classpath defined. This would look something like: Manifest-Version: 1.0Sealed: trueMain-Class: com.CalculatorClass-Path:

Copy Multiple Items in the Clipboard

Many times during coding you feel the need to keep more than one block of code in your clipboard.Visual Studio provides a wonderful feature for this using the clipboard ring.

Customize Your Template Function

If a function instantiated from a generic template definition does not suit your need, it’s possible to provide a specialized definition for that function template instantiation. Take a look at