The Visual Basic language has several new functions and enhancements that can greatly simplify some types of common programming tasks. For example, there are five new string functions that are a welcome addition to the bag of tricks available for working with strings. Each of these new functions is demonstrated throughout this book, but I'll list them here for quick reference: Filter, InStrRev, Join, Replace, and Split. Keep your eyes open in later chapters and you'll see how these little miracles can save you lots in your programming efforts!
In addition to the new string functions, there's one important new mathematical function I want to mention right up front. The Round function lets you round off a number to a specified number of digits. This could be accomplished before, using string conversions or tricky math, but the Round function simplifies the process and provides much faster operation. The Round function carries out the very common programming task of rounding money amounts to the nearest cent, as I've demonstrated in the Loan object in Chapter 5, "Object-Oriented Programming."
A whole range of clever new programming possibilities is opened up by the new CallByName function, which lets an application access a property or a method of an object by referring to it by its name as stored in a string.
The new FileSystem objects provide an entirely new way for your Visual Basic applications to interact with files. This object-oriented approach to traversing files and working with drives, folders, files, and all their properties, is a carry-over from the C++ world. It has some distinct advantages and provides easy solutions to some notably tricky but common programming tasks involving the file system.
There are several enhancements to Visual Basic that free you from some restrictions of earlier versions. User-defined types (UDTs) are now allowed as arguments and return types of public properties and methods. Functions and property procedures can now return entire arrays. Variable-sized arrays, also referred to as SAFEARRAYs, can now appear on the left side of an assignment.
There are quite a few other changes and enhancements in Visual Basic 6, such as many new functions and properties in Visual Basic for Applications. Throughout this book I've tried to use the very latest functions, features, and ways of doing things, wherever possible.