May 93 - Three MacApp 3.0.1 Shortcuts
Three MacApp 3.0.1 Shortcuts
Ken Victor
The following three shortcuts have made my life much simpler while developing a new
MacApp 3.0.1 application using C++.
Try and Catch Macros
In a past issue of "Develop" magazine, the C macros for Try and Catch were defined for
MacApp 2. I got used to using these when I was developing a MacApp 2 product using
C++, and although the MacApp 3 approach to exception handling is easier to use with
C++, I wanted to continue to use Try and Catch. I find this more meaningful to read
than if fi.Try(). So here is my version for MacApp 3:
#define try
FailInfo fi;
if (fi.Try()) {
#define catch
fi.Success();
}
else
#define try2
if (fi.Try()) {
#define success fi.Success()
#define resignal fi.ReSignal()
Thus you can write code that looks like the following:
try {

}
catch {

resignal;
}
or: