04-08-2014 02:33 AM
i want to know, what is "fCall"? where is the definition?i research it everwhere,but cannot find it!
Solved! Go to Solution.
04-08-2014 03:41 AM
Hi,
I think you are referring to the nullChk and errChk macros.
They are macro definitions for error handling.
fCall is a placeholder for the function you input to that macro.
Whatever you type in place of fCall is copied-pasted as it is.
You call it like: errChk (SetCtrlVal(panel, ctrl, val));
This call runs the SetCtrlVal function, returns its result into a variable named error, if the return value is less than 0 then, it jumps to a label named Error.
If you call this macro in your code, you need to define the error variable and put a label Error somewhere in your code. Otherwise you get compile errors.
Search inside the samples folder to see its usage.
Also read some articles about error handling for more information.
04-08-2014 03:50 AM
The SetCtrlVal function I used above was just an example.
The key point is, your function has to return negative integer values only for error conditions.
These macros are used to make sure you catch and handle the errors you want during a program execution.
Macros are a programming tool for C, but they also open the gates for a lot of problems if not used carefully.
04-10-2014 03:36 AM
thank you for your explain!非常感谢!