March 9, 2002

DevX - Software Development Resource

Exiting a Nested Loop

Sometimes, you need to exit a nested loop early, and the break; statement will only let you exit one level of a loop. Use a flag to indicate if the

DevX - Software Development Resource

Sorting a String Alpabetically

To Sort a String in alphabetical order instead of ASCII order (i.e A,a,B,b not A….Z,a….z), use the Collator class from the Java.text package.Here

DevX - Software Development Resource

Reading Properties from a File

It’s not too much trouble to read a few arguments from the command line. It really becomes a problem if you have to read 50 or more arguments. One solution

DevX - Software Development Resource

Avoid Errors on Assigning Null Values

Whenever you read a database field, concatenate an empty string to the field value before assigning it to a variable or control property. This prevents the program from giving an

DevX - Software Development Resource

Passing ByVal to ByRef Parameters

By default, VB passes all arguments to a procedure by reference, which means the procedure can change the values of the variables you pass. However, there

DevX - Software Development Resource

Center Your Logo on MDI Forms

You can display a logo in the middle of your MDI form. The logo stays in the middle even when the MDI form is resized. After creating your own MDI

DevX - Software Development Resource

View the Right Side of a Truncated String

You see trailing ellipses (…) when VB truncates either the expression or data portion of a data tip (the mouse-hover watch value you get while debugging). This is great if