A list of products available on this site
Documentation for XtraMania's xtras
Prices and links to the online store
Xtras, PDFs, samples
Have a question? Ask us!
Contacts
Logo. www.xtramaina.com  
Home Search E-mail
VbScriptXtra Reference/objAuto.LastErrorCode

objAuto.LastErrorCode

Syntax

nErrorCode=objAuto.LastErrorCode

Returns

An integervalue with last error's code or 0 if the last call was successful.

Description

Use LastErrorCode property to get the numerical code of a error occurred. Use debug mode to automatically get error descriptions in Messages window.
List of possible error codes depends on the actual Automation object being used. See documentation for that object.
Use LastError property to get the textual description of a error occurred.

Two types of errors might occur with VbScriptXtra depending who detects error condition either VbScriptXtra or wrapped COM Automation object. For example type casting routine of VbScriptXtra might return a error in case it cannot typecast Lingo value into COM Automation value. This is a VbScriptXtra-level error. LastErrorCode returns -1 in this case.
The other type of errors occures inside COM library or a wrapped object. I this case LastErrorCode returns the value provided by COM library or wrapped object.

If the last call was successful, then LastErrorCode returns 0.

See Debugging for related information.

Sample

if objAuto.LastErrorCode0 then
  put objAuto.LastError
end if

Site homeSearchContact author © Eugene Shoustrov. www.xtramania.com