August 11, 2000

Selecting Three Radio Buttons

Question: I want to validate a form so that three radio buttons may be checked, but no more. This will be used in a “what are your top three choices” type of situation Answer: Radio buttons are, by definition, a type of button where only one of a group can

Void Function Arguments

Question: Why does Java accept function declarations like public void func(); but not declarations like public void func(void); Answer: Java is not C. Despite the similar syntax, all C idioms do not translate to Java. In C, an empty argument list in a function prototype implies that the function may

JavaScript Browser Detection

Question: When loading a web page, I need to have JavaScript look at the browser it is loading into, and if it is not version 5 (Internet Explorer 5), I want it to load a gif image within the web page. If it is loading into a browser that is

Mouse Position

Question: Can I retrieve the position of the mouse on the screen? I need to know the X and Y coordinates because I want to position a layer at that position to create a ‘tooltip’-like behavior. Answer: For IE, the position is at window.event.x and window.event.y. For Netscape, the position

Multi-dimensional Arrays

Question: Can I create multi-dimensional arrays in JavaScript? Do you have an example? Answer: Yes and no. You can’t create multi-dimensional arrays (as such) in JavaScript. What you can do is create an array of arrays, though.For instance, you can have: numberArray = new Array(“one”,”two”,”three”)letterArray = new Array(“a”,”b”,”c”)bigArray = new

Store Procedure and View Creation

Question: We need to create a view based on about 1600 tables. One of the problems is that we cannot enter all of the query into the buffer because the query takes too much space (more than 32k). Can we create a view by calling some store procedure? If so,

Project Reference

Question: In a code I’m developing, I am getting a “can’t find project or library” error message when it gets to the following functions: Chr(), Right(), Left(). Aren’t these VB predefined functions? If not, what project reference do I need to add? Answer: This error message usually means there is

Use of SocketImpl Class

Question: What is the SocketImpl class used for? Answer: SocketImpl is an abstract class that provides an interface for customizing socket implementations. Subclasses of SocketImpl are not intended to be explicitly instantiated. Instead, they are created by a SocketImplFactory. The motivation for this design is to allow you to change

Interface vs. Abstract Class

Question: What is the difference between an interface and an abstract class? Answer: Within the confines of Java syntax, an interface is a type that only defines abstract methods and constant members. In a more general sense, an interface is an abstract class that defines no implementation. Neither an interface

No more posts to show