mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 09:09:30 +02:00
+ Added delphi compatibility Error procedure
git-svn-id: trunk@3610 -
This commit is contained in:
parent
bb7f62a2cf
commit
5ef20e6215
@ -779,6 +779,12 @@ Begin
|
||||
Halt(0);
|
||||
End;
|
||||
|
||||
Procedure Error(RunTimeError : TRunTimeError);
|
||||
|
||||
begin
|
||||
RunError(RuntimeErrorExitCodes[RunTimeError]);
|
||||
end;
|
||||
|
||||
|
||||
function do_isdevice(handle:thandle):boolean;forward;
|
||||
|
||||
|
@ -212,7 +212,7 @@ Type
|
||||
|
||||
HRESULT = type Longint;
|
||||
TDateTime = type Double;
|
||||
Error = type Longint;
|
||||
TError = type Longint;
|
||||
|
||||
PSingle = ^Single;
|
||||
PDouble = ^Double;
|
||||
@ -247,7 +247,7 @@ Type
|
||||
PAnsiString = ^AnsiString;
|
||||
|
||||
PDate = ^TDateTime;
|
||||
PError = ^Error;
|
||||
PError = ^TError;
|
||||
PVariant = ^Variant;
|
||||
POleVariant = ^OleVariant;
|
||||
|
||||
@ -656,6 +656,28 @@ Function GetThreadID:TThreadID;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
Init / Exit / ExitProc
|
||||
*****************************************************************************}
|
||||
|
||||
type
|
||||
TRuntimeError =
|
||||
(reNone, reOutOfMemory, reInvalidPtr, reDivByZero, reRangeError,
|
||||
reIntOverflow, reInvalidOp, reZeroDivide, reOverflow, reUnderflow,
|
||||
reInvalidCast, reAccessViolation, rePrivInstruction, reControlBreak,
|
||||
reStackOverflow, reVarTypeCast, reVarInvalidOp, reVarDispatch,
|
||||
reVarArrayCreate, reVarNotArray, reVarArrayBounds, reAssertionFailed,
|
||||
reExternalException, reIntfCastError, reSafeCallError, reQuit,
|
||||
reCodesetConversion);
|
||||
|
||||
Const
|
||||
// Please keep locations corresponding to location in array above
|
||||
RuntimeErrorExitCodes : Array[TRuntimeError] of Byte = (
|
||||
0 , 203, 204, 200, 201,
|
||||
215, 207, 200, 205, 206,
|
||||
219, 216, 218, 217,
|
||||
202, 220, 221, 222,
|
||||
223, 224, 225, 227,
|
||||
0 , 228, 229, 233,
|
||||
234);
|
||||
|
||||
Procedure Error(RunTimeError : TRunTimeError);
|
||||
Function Paramcount:Longint;
|
||||
Function ParamStr(l:Longint):string;
|
||||
Procedure Dump_Stack(var f : text;bp:pointer);
|
||||
|
@ -303,9 +303,9 @@ operator :=(const source : tdatetime) dest : variant;{$ifdef SYSTEMINLINE}inline
|
||||
end;
|
||||
|
||||
|
||||
operator :=(const source : error) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : terror) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
Variantmanager.varfromInt(Dest,Source,-sizeof(error));
|
||||
Variantmanager.varfromInt(Dest,Source,-sizeof(terror));
|
||||
end;
|
||||
|
||||
{**********************************************************************
|
||||
@ -493,7 +493,7 @@ operator :=(const source : variant) dest : olevariant;{$ifdef SYSTEMINLINE}inlin
|
||||
end;
|
||||
|
||||
|
||||
operator :=(const source : variant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : variant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
dest:=variantmanager.vartoint(source);
|
||||
end;
|
||||
@ -785,7 +785,7 @@ operator :=(const source : olevariant) dest : tdatetime;{$ifdef SYSTEMINLINE}inl
|
||||
end;
|
||||
|
||||
|
||||
operator :=(const source : olevariant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : olevariant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
dest:=variantmanager.vartoint(variant(tvardata(source)));
|
||||
end;
|
||||
@ -938,9 +938,9 @@ operator :=(const source : tdatetime) dest : olevariant;{$ifdef SYSTEMINLINE}inl
|
||||
end;
|
||||
|
||||
|
||||
operator :=(const source : error) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : terror) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
variantmanager.olevarfromint(dest,source,-sizeof(error));
|
||||
variantmanager.olevarfromint(dest,source,-sizeof(terror));
|
||||
end;
|
||||
{**********************************************************************
|
||||
Variant manager functions
|
||||
|
@ -253,7 +253,7 @@ operator :=(const source : comp) dest : variant;{$ifdef SYSTEMINLINE}inline;{$en
|
||||
{ Misc. }
|
||||
operator :=(const source : currency) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : tdatetime) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : error) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : terror) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
|
||||
{**********************************************************************
|
||||
from Variant assignments
|
||||
@ -303,7 +303,7 @@ operator :=(const source : variant) dest : olevariant;{$ifdef SYSTEMINLINE}inlin
|
||||
{ Misc. }
|
||||
operator :=(const source : variant) dest : currency;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : variant) dest : tdatetime;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : variant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : variant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
|
||||
{**********************************************************************
|
||||
Operators
|
||||
@ -378,7 +378,7 @@ operator :=(const source : olevariant) dest : comp;{$ifdef SYSTEMINLINE}inline;{
|
||||
{ Misc. }
|
||||
operator :=(const source : olevariant) dest : currency;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : olevariant) dest : tdatetime;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : olevariant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : olevariant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
|
||||
{**********************************************************************
|
||||
to OLEVariant assignments
|
||||
@ -425,7 +425,7 @@ operator :=(const source : comp) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{
|
||||
{ Misc. }
|
||||
operator :=(const source : currency) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : tdatetime) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : error) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
operator :=(const source : terror) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
|
||||
{**********************************************************************
|
||||
OLEVariant Operators
|
||||
|
Loading…
Reference in New Issue
Block a user