devxlogo

March 9, 2002

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

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

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

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

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

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

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