July 10, 1998

Invoking a JavaScript Function

For the two major browsers, the easiest way to invoke a JavaScript function is create a java.net.URL instance using the JavaScript: protocol handler. To invoke the JavaScript command, pass the URL to showDocument() in java.applet.AppletContext. Using a different method will tie you to the specific browser, and if you need

Display Horizontal Scrollbar

Unlike the Windows 95 common controls, the standard list box doesn’t have a horizontal scrollbar when list items are too wide to fit within the list box. Fortunately, it’s not hard to direct a list-box control to display a horizontal scrollbar. Add this code to a form’s Load event. It

Get the True Member of an Option Array

Setting an element in an array of option buttons to True is easy. Click on the option button, or use this code: OptionArray(ThisOne) = True ThisOne is the Index of the member you want to be selected. Getting the True member of an option array is not so simple. Because

Browser Detection from Applet

The Java core API includes a class called java.lang.System from which system dependent operations can be performed. One of the methods of the System class is getProperty(String) which will return a value for some system defined property. Properties can be defined on the command line to configure an application by

Protect Data Within Modules

Use Private variables in BAS modules to protect data that the module’s routines must access, but which should be hidden from the rest of the application: Dim hidden_data As IntegerFunction GetData() As Integer GetData = hidden_data * 2End Function

Convert a Text File into Access MDB

It can be troublesome to convert a text file into an Access database. It takes a lot of time to open the file for sequential access and create new records using the AddNew method. Instead, use the Text ISAM driver and SQL to do the job for you. First, create

Debug Error Handlers

Visual Basic gives you the option to turn off error trapping in your projects. This is useful when you suspect that your error handlers contain errors themselves. To turn off error handling globally, choose Options from the Tools menu. Select the General tab, and select Break on All Errors. The

Quick and Easy SCHEMA.INI

To create a SCHEMA.INI file for a text file quickly and easily, let the ODBC setup and drivers do it for you. Go to the Control Panel and start ODBC. Click on the Add button and select the Text driver. Click on the Options button and describe how to arrange

Use Boolean Variables for Check-Box Values

Visual Basic specifies a Boolean’s default values as zero for False and -1 for True. You may save and set the value of a check box, based on the absolute value of a Boolean variable, as these correspond to the intrinsic constants vbUnchecked and vbChecked: Dim bBool as BooleanbBool =

No more posts to show