Tip Bank

DevX - Software Development Resource

Checking If a File is in Use

Question: How can I check to see if a file is in use/open? Answer: An easy way to do this is to attempt to open the file for writing. If

DevX - Software Development Resource

Copying Part of a String

Question: I have a little problem which I can’t solve. I will give the question with an example. I’m working with Excel. In a cell the string “100dpi.txt” is written.

DevX - Software Development Resource

Maximum Number of Objects on a Form

Question: Is there any way to get more than 255 objects on a VB form? Answer: No, there’s not a way to pass the limit of 255 objects per form.

DevX - Software Development Resource

Manually Positioning Buttons in a Java Applet

You can use Java’s layout managers to maintain the relative position of objects in an applet without manually repositioning them as the applet’s size changes. However, you may occasionally want

DevX - Software Development Resource

Where Should Template Definitions Appear?

Normally, you declare functions and classes in a .h file and place their definition in a separate .cpp file. With templates, this practice isn’t really useful because the compiler must

DevX - Software Development Resource

The First Rule of Code Optimization

I recently received a question from a reader who asked how to sort a large file. My solution was based on the qsort() algorithm, which is the only sorting algorithm

DevX - Software Development Resource

Floating Point Literals

In following expression: if (ticket_price > 7.50) What’s the type of the literal 7.50? One might think that it’s float. However, the actual type is double. To force the compiler