User Guide
Defining and Using Custom Functions 257
}
else
{
// Need to return error value
// Caller will look at value and then decide to look at errorInfo
// Alternatively, caller can look at errorInfo and see whether
// some pre-defined fields are available
return -1; // or "" or whatever we have agreed to...
}
}
errorInfo = structNew();
result = bigCalc(x, y, errorInfo);
if (result eq -1)
{
// use information from errorInfo
}
or
if (structKeyExists(errorInfo, "errorMsg"))
{
// error
}
anotherResult = bigCalc(x + 10, y + 30);
...