devxlogo

Tip Bank

Include Guards

#including a file more than once during the same compilation session will most likely cause the compiler to issue error messages since definitions and declarations of the file are repeated.

Seed the Random Number Generator

You can use Rnd followed by Randomize to seed Visual Basic’s random number generator. Whenever you use the same seed, Rnd produces the same sequence of random numbers: Rnd -1Randomize

Better Auto-Propercase

The “Auto-Propercase Text Box at Entry” tip [VBPJ May 1997, page 63] has a simpler solution. The StrConv function can propercase any string. You can achieve the same effect with

Convert from Fractional to Decimal Numbers

While developing a database front end for hand-tool management, I discovered a need to handle both fractional and decimal representations of dimensions in the same text box. This makes it

Avoid Form Confusion

When you define a form named MyForm, Visual Basic creates one instance with the name “MyForm.” Many programmers confuse this special instance with other instances created using Dim. For example,

E-mail Address Syntax

Question: We want to begin collecting customer e-mail addresses from our Web site. Our current file system is mainframe based, storing all data in uppercase format. Are e-mail addresses case

Optional Parameters in ASP

Question: In my Visual Basic ActiveX DLLs, some of the methods that I created for my objects use optional parameters. When I attempt to call these methods, I receive a

Side-by-side Tables

Question: I have noticed that some sites have tables that sit side-by-side. I can never duplicate this behavior with my HTML scripts. Do you have any suggestions? Answer: Positioning two