February 25, 2000

DevX - Software Development Resource

Create a Safer Mid Function

If you often write complex string-parsing and manipulation algorithms, the last thing you want is to add more checks to ensure your string positions are not negative. Avoid the hassle

DevX - Software Development Resource

Enhance the Replace Function

If you’re faced with a string that needs to have certain characters removed from it, use the Replace() function to make the problem more manageable. For instance, use this code

DevX - Software Development Resource

Write an IsTime Function

Use this function to determine whether a string represents a valid time: Public Function IsTime(sTimeArg As String) As Boolean IsTime = IsDate(Format(Date, “short date”) & _ ” ” & sTimeArg)End

DevX - Software Development Resource

Use Screen-Saver Passwords

When you write a screen saver in C and the Windows SDK, a static library (SCRNSAVE.lib) allows you to create custom dialogs to change and request the password. But in

DevX - Software Development Resource

Enhance the Trim Function

The Trim function has a serious shortcoming: It handles only space characters?not all the usual white spaces such as tabs, carriage returns, and line feeds. Instead of the standard Trim

DevX - Software Development Resource

Query Objects for Initialization State

In a large app, or even a small one, you can use Property Let and Property Get to make sure necessary variables and subsystems are initialized. This code is from

DevX - Software Development Resource

Functions Parse Command Lines

Handling multiple command-line arguments has always been ugly in VB, especially when some of the arguments are quoted because they contain characters such as spaces. For example, if you want