devxlogo

Tip Bank

Get the exit code of a process

In a few cases, in particular when running MsDos batch files from within a VB application, you may want to determine the ERRORLEVEL set by an external application. You can’t

Check for a valid URL

Before posting an Internet request you should check that the user has entered a valid Internet address. You can do this with a parsing routine, or use the following routine

Sorting on multiple keys

Frequently you need to sort arrays of records using multiple keys. This may be required since one single key does not uniquely identify a record (e.g. you may need both

Determine whether a control has a scrollbar

There is no built-in VB function that lets you know whether a control – such as a ListBox – is currently displaying a vertical scrollbar. Here’s a pair of functions

Determine memory usage

The GlobalMemoryStatus API function returns detailed information about the current load on the physical and virtual memory. You can use the following code to display the current amount of free

Check if a Given String Is a Palindrome

This code checks if a given string is a palindrome. Public Function IsPalindrome(strToCheck As String) As BooleanDim iForward As IntegerDim iBack As IntegerDim iMid As IntegerDim bPalindrome As BooleanIsPalindrome =

Use Explicit Template Instantiation

Instead of depending on the compiler to instantiate your template, youshould explicitly instantiate them using the following statement: template class vector; // for class instantiationtemplate int& vector::operator[] (int); // for

Exporting SQL Server Results to XML

Beginning with SQL Server 2000, Microsoft added support for SQL-XML interoperability. They did this by expanding some statements that we all know

Detecting Memory Leaks in Palm OS

Memory is precious in Palm OS, so you can’t afford any memory leaks in programs. Therefore, it’s very essential to detect any memory leaks. To do this put breakpoints in