October 17, 1998

Network Programming, Simple Browser

With Java, you can easily write a client program that connects to a Web server and downloads an HTML file. You can also easily expand this simple program into a Web crawler by parsing the downloaded file, extracting the links referenced in that file, and using similar code to download

Network Programming, TCP/IP Client, Get The Time

With Java, it’s easy to write a client program that connects to a TCP/IP server to get the date and time. This is very useful for network testing. Insert your favorite Web server name into the String named server. The program should then display the date and time at the

Jump Back and Forth Among Procedures Quickly

My code often has a lot of nested procedure calls, which can be painful to trace while doing walk-throughs. Developers might be unaware of the “Procedure Definition” (Shift+F2) feature, which provides a way to go to the code of a called procedure. This is particularly convenient if you like to

Doubling Quotes for SQL Statements

This routine parses a string and returns an equivalent string where all the instances of a given substring are doubled. This is especially useful for doubling quotes within SQL statements to be passed to Access or other database engines that expect double quote marks to represent a single quote mark:

Use Pictures on Command Buttons

To use a picture on a CommandButton, you must set its Picture property and set its Style to 1 – Graphical. Otherwise, the picture will be ignored.

Use VB System Color Constants in API Calls

Visual Basic includes constants, such as vbActiveTitleBar and vbButtonFace, for Windows system colors, which the user might change through the Control Panel. (In VB3, these constants are defined in the file CONSTANT.TXT.) When you assign one of these constants to a VB color property, Visual Basic automatically translates it to

Overloading a Member Function Across Class Boundaries

Since a class is a namespace, the scope for overloading a member function is confined to the class containing this function. Sometimes, it is necessary to overload the same function in its class as well as in a class derived from it. Using an identical name in a derived class

Change Tooltips Background Color

To change the ToolTips background color, open the Control Panel’s Display tool. Click on the Appearance tab. In the Item combo box, select ToolTip. Click on the little color box to change the color.

Function Wrappers – The First Step toward Gaining OO Advantages

In large-scale projects different teams use API functions developed by another team or a third-party vendor. For example: int retrievePerson (int key, Person& recordToBefilled); // original version; used by all teams A problem can arise when the interface of an API is modified by the implementer; all of its users