









Write concise code: a collection of simple tips
If you fully understand how VB and VBA work, you can often save some statements. This makes your listings more concise and more readable, and indirectly optimizes your program. Here
If you fully understand how VB and VBA work, you can often save some statements. This makes your listings more concise and more readable, and indirectly optimizes your program. Here
Let’s assume you must test whether the most significan bit of an integer value is set or not. This is the code that you usually write: ‘ two cases, depending
You can often use the Instr function in an unorthodox way to write more concise code. A typical example is when you need to test a single character: ‘ test
Use IIf when setting a value based upon an expression. This works only in situations where you have two choices, based upon the result of a Boolean expression. ‘long wayIf
When setting a Boolean value based upon the result of an expression, avoid using an unnecessary If/Then/Else structure. ‘Instead of using this lengthy syntax . . .If SomeVar > SomeOtherVar
Many VB developers don’t realize that the Switch built-in function can often save a lot of code. This function takes any number of (expr, value) pairs, it evaluates all expressions
The Choose function lets you often make more concise, albeit not faster, code, because it lets you replace a lengthy Select Case block. For example, the following code: Select Case
It is always easy for people who know Visual Basic to write code inVBScript. But sometimes you make some common mistakes because of the implementation differences between VB and VBScript.One
If you want to rebuild the master database you can run Rebuildm.exe command prompt utility. This utility allows you to rebuild the master database to change the character set, sort