📄 my.h
字号:
//my.h file
#ifndef _ERROR_INFO_H_
#define _ERROR_INFO_H_
#define BEGIN_CATCH_MATH_ERROR int entire_error;CString entire_info;\
int _matherr( struct _exception *except){
#define _BEGIN_GET_TYPE switch(except->type){
#define GET_ERROR_TYPE(type,value,string) \
case type: \
entire_error=type;\
except->retval=value;\
entire_info=#string;\
break;
#define _END_GET_TYPE default:\
break;\
}
#define GET_ERROR_FUNCTION(function,string) if(strcmp( except->name, #function) == 0)\
entire_info=(#string)+entire_info;
#define END_CATCH_MATH_ERROR return 1;}
#define DECLEAR_CATCH_ERROR void clearError(BOOL);\
void SaveErrorInfo(int,BOOL,CString);\
struct _errorInfo{\
int m_errorNumber;\
BOOL m_formulaError;\
CString m_errorInformation;\
}m_errorInfo;
#define IMPLEMENT_CATCH_ERROR(calss_name) void calss_name::clearError(BOOL f){\
if(entire_error){\
SaveErrorInfo(entire_error,f,entire_info);\
entire_error=0;}\
}\
void calss_name::SaveErrorInfo(int error, BOOL f, CString info){\
m_errorInfo.m_errorNumber=error;\
m_errorInfo.m_errorInformation=info;\
m_errorInfo.m_formulaError=f;\
}
#define _CLEAR_ERROR(value) clearError(value);
#define _SAVE_ERROR_INFO(error,bRet,string) SaveErrorInfo(error,bRet,string);
#define GET_ERROR_INFORMATION(value) if(m_errorInfo.m_formulaError)\
value="Expression error: "+m_errorInfo.m_errorInformation;\
else\
value="Evaluate error: "+m_errorInfo.m_errorInformation;
#define GET_ERROR_NUMBER return m_errorInfo.m_errorNumber;
#define GET_EXPRESSION_ERROR return m_errorInfo.m_formulaError;
#define PROCESSION_ERROR if(m_errorInfo.m_errorNumber){\
if(m_errorInfo.m_formulaError)\
return BIGNUMBER;\
else\
_SAVE_ERROR_INFO(0,FALSE,"Good!");\
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -