August 8, 1998

Set Printer Margins

You can use the Printer’s scale properties to set margins. Set the properties so the position (0, 0) is mapped to where you want the margins. This code makes the

Make a Form Stay on Top

You can make a form always remain above others, even when it does not have focus. Use this code in a BAS module: #If Win16 Then Declare Sub SetWindowPos Lib

Perform One-Time Initialization

You can use static variables to perform one-time initialization: Private Sub GetValue()Static initialized As Boolean If Not initialized Then ‘ Perform one-time initialization. : initialized = True End If ‘

Use Explicit Object Types for Speed

It is much faster to use explicit object data types instead of generic ones. In this test that simply sets an object’s public variable, the generic object takes more than

Create Global Properties

You can create property procedures in a BAS module. The rest of your program treats the “property” like any other variable, but the property procedures can perform error checking and

Error ‘ASP 0115’

If you are developing in Visual Basic for Active Server Pages (ASP), there are two likely causes of an error ‘ASP 0115’. The VB5 setup wizard puts a number of

Hidden IP Address

One of the easiest ways to grab an IP address is to use request.servervariables(“REMOTE_ADDR”) and then store the value as a hidden field in your form. When the user submits

Creating Instance of InetAddress

InetAddress objects can be instantiated only by doing a hostname or address lookup by calling any one of the static lookup methods in the InetAddress. For example, to create an