Tip Bank

DevX - Software Development Resource

Order Objects Constructed on a Window

Question: I have a number of datawindows in a window. In a post-construct event I am making a call to another datawindow. Every so often when I open the window

DevX - Software Development Resource

Explaining the Modulus Operator

Question: What does the modulus (%) operator do? Answer: The modulus operator returns the remainder of a division operation. For example, 5%2 equals 1 because dividing 5 by 2 gives

DevX - Software Development Resource

Caching JavaScript Files

Question: If I include a .js file using the src attribute of a script tag and then I need to change the content of the .js file (perhaps to correct

DevX - Software Development Resource

Display an Alert After the Page Loads

Question: How do I make an alert box pop up 10 seconds after the page loads? Answer: You can display an alert a certain length of time after the page

DevX - Software Development Resource

Generate a Random Whole Number in JavaScript

You can generate random numbers in JavaScript using the Math.random() method. This function returns a fractional random number between 0 and 1. Unlike other languages, JavaScript will initialize a random

DevX - Software Development Resource

Where Are Exception Objects Stored?

Consider the following program: class Exception {}; int main() { try { throw Exception(); // where is the exception stored? } catch( Exception & ex) // catch by reference {}

DevX - Software Development Resource

Heap or Free-Store?

The terms heap and free-store are used interchangeably when referring to dynamically allocated objects. Are there any differences between the two? Technically, free-store is an abstract term referring to unused

DevX - Software Development Resource

Validating Data Entries

Suppose you have an application that reads input from the keyboard. How can you detect whether alphabetic data is being entered into an integer field from a cin statement? The