www.icetips.com  Icetips Utilities Documentation 11/30/2010    

Utility Class: ErrorMsg

Previous  Top  Next  


Prototype:  (Byte pStdErr=True, Byte pFilErr=False, <String pSeparator>),String

 

pStdErrIndicates if error information from ErrorCode() and Error() should be included in the error string.  This defaults to True

 

pFilErrIndicates if error information from FileErrorCode() and FileError() should be included in the string.  This defaults to False.

 

[pSeparator]Indicates a separator string used between the standard errors and the file errors.  If omitted it defaults to a single space character.

 

ReturnsString containing formatted error message.

 

This method returns a formatted error message in the format of:

 

(ErrorCode) Error Separator (FileErrorCode) FileError

 

If you are going to show the error string in a Message() function, then you could pass '<13,10>' as separator to put the standard error and file error on separate lines. 

 

Note:

When working with SQL drivers any SQL errors that come from the backend database engine trigger errorcode 90.  In that case the FileErrorCode() and FileError() will contain extended error information that comes from the database engine.  If you are dealing with SQL engines, always pass True as the second parameter to make sure that you will get that extended error information.  Otherwise you will simply get error code 90 - File Driver Error, which doesn't really tell you anything about the actual problem.  If you know that you are only going to be getting errors from the database engine, i.e. error 90, then you can simply leave the first parameter, pStdErr as false.  Then this method will only return the extended error information from the backend. 

 

Example:

 

ITU  ITUtilityClass

Code

Add(MyFile)

Case ErrorCode()

Of 90

  Message('SQL Error: ' & ITU.ErrorMsg(False,True)

Else

  Message('Error: ' & ITU.ErrorMsg(True,True,'<13,10>')

End

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/errormsg_utility.htm