New Learning VFP video
This video is on the topic of Error Handling. A far too often overlooked aspect of software development that is absolutely critical to creating great applications. Error handling in Visual FoxPro runs the gamut, from the familiar ON ERROR command used for procedural error handling, to the fairly new Try…Catch…Finally structured error handling. Visual FoxPro offers a surprising number of choices and solutions when it comes to error handling. Find out the strengths and weaknesses of each through this 3 part video. Beginners can expect to get a handle on the basics and intermediates might learn a few things about some of the more obscure stuff such as the COMRETURNERROR function for use in COM servers.

Video Timeline
A suggestion was made after my last video that I provide a timeline detailing the contents of the Learning VFP videos so that viewers can quickly find what they are looking for. I also think it helps viewers know what they can expect to learn in the videos, so here is the timeline/guide for this 3 part video series on error handling…

Part1 – Total Length 25:05
00:00 Introduction
01:05 Basic ON ERROR command use
05:47 Conditional error handling with ON ERROR command
08:33 Use of RETRY
10:38 Use of AERROR() to retrieve error info
15:00 Throwing an exception using ERROR command
19:53 Use of ASTACKINFO() to retrieve call stack info

Part2 – Total Length 33:20
00:00 Basic Try…Catch…Finally use
07:55 Conditional error handling with Try…Catch
12:10 User-defined errors and exception subclassing
21:42 Nesting Try…Catch…Finally blocks
25:20 Exception escalation using Throw

Part3 – Total Length 29:32
00:00 Creating a user-friendly error form and emailing errors
10:48 The Error Event and overall error handling priority
17:48 Using the COMRETURNERROR command in COM Servers
28:40 Wrap-up

Learning Visual FoxPro 104: Error Handling

For Online Viewing (same content as offline version):
Part I 
Part II 
Part III 

For Offline Viewing (same content as online version):
Download Part1 SWF File
 (13.3 MB approx.)
Download Part2 SWF File (16.2 MB approx.)
Download Part3 SWF File (19.4 MB approx.)

Source Code used in the video:
Download 104 Source Code (198 KB approx.)

If you have any problems understanding any of the concepts presented in this video, be sure to try out the source code that accompanies this 3 part video series. While a screencast works pretty good for imparting information, nothing can beat trying a few things on your own and stepping through some code when trying to understand scope in Visual FoxPro. The files included in the source download for this video series should make it easier for you to explore all the different aspects of error handling in Visual FoxPro.

NOTE: I haven’t forgotten Learning VFP 103. It’s on the way, I just haven’t had time to finish it yet.