xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

SetLastError()

Sets a numeric value as last error code.

Syntax

SetLastError( <nNewErrorCode> ) --> nOldErrorCode

Arguments

<nNewErrorCode>
This is the numeric value specifying the new return value of function GetLastError().

Return

The function returns the current error code of GetLastError().

Description

SetLastError() is used to void any previous error code returned by GetLastError() before a DLL function is executed. Normally, the function is called with the parameter 0, which means "no error". If GetLastError() returns a value <> 0 when the DLL function has returned, a programmer can be sure that the error occured within this DLL function.

Info

See also:CallDll(), DllCall(), GetLastError()
Category: DLL functions , xHarbour extensions
Source:rtl\dllcall.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe