mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 05:09:49 +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);
|
Halt(0);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Procedure Error(RunTimeError : TRunTimeError);
|
||||||
|
|
||||||
|
begin
|
||||||
|
RunError(RuntimeErrorExitCodes[RunTimeError]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_isdevice(handle:thandle):boolean;forward;
|
function do_isdevice(handle:thandle):boolean;forward;
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ Type
|
|||||||
|
|
||||||
HRESULT = type Longint;
|
HRESULT = type Longint;
|
||||||
TDateTime = type Double;
|
TDateTime = type Double;
|
||||||
Error = type Longint;
|
TError = type Longint;
|
||||||
|
|
||||||
PSingle = ^Single;
|
PSingle = ^Single;
|
||||||
PDouble = ^Double;
|
PDouble = ^Double;
|
||||||
@ -247,7 +247,7 @@ Type
|
|||||||
PAnsiString = ^AnsiString;
|
PAnsiString = ^AnsiString;
|
||||||
|
|
||||||
PDate = ^TDateTime;
|
PDate = ^TDateTime;
|
||||||
PError = ^Error;
|
PError = ^TError;
|
||||||
PVariant = ^Variant;
|
PVariant = ^Variant;
|
||||||
POleVariant = ^OleVariant;
|
POleVariant = ^OleVariant;
|
||||||
|
|
||||||
@ -656,6 +656,28 @@ Function GetThreadID:TThreadID;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|||||||
Init / Exit / ExitProc
|
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 Paramcount:Longint;
|
||||||
Function ParamStr(l:Longint):string;
|
Function ParamStr(l:Longint):string;
|
||||||
Procedure Dump_Stack(var f : text;bp:pointer);
|
Procedure Dump_Stack(var f : text;bp:pointer);
|
||||||
|
@ -303,9 +303,9 @@ operator :=(const source : tdatetime) dest : variant;{$ifdef SYSTEMINLINE}inline
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
operator :=(const source : error) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : terror) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
Variantmanager.varfromInt(Dest,Source,-sizeof(error));
|
Variantmanager.varfromInt(Dest,Source,-sizeof(terror));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{**********************************************************************
|
{**********************************************************************
|
||||||
@ -493,7 +493,7 @@ operator :=(const source : variant) dest : olevariant;{$ifdef SYSTEMINLINE}inlin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
operator :=(const source : variant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : variant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
dest:=variantmanager.vartoint(source);
|
dest:=variantmanager.vartoint(source);
|
||||||
end;
|
end;
|
||||||
@ -785,7 +785,7 @@ operator :=(const source : olevariant) dest : tdatetime;{$ifdef SYSTEMINLINE}inl
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
operator :=(const source : olevariant) dest : error;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : olevariant) dest : terror;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
dest:=variantmanager.vartoint(variant(tvardata(source)));
|
dest:=variantmanager.vartoint(variant(tvardata(source)));
|
||||||
end;
|
end;
|
||||||
@ -938,9 +938,9 @@ operator :=(const source : tdatetime) dest : olevariant;{$ifdef SYSTEMINLINE}inl
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
operator :=(const source : error) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : terror) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
variantmanager.olevarfromint(dest,source,-sizeof(error));
|
variantmanager.olevarfromint(dest,source,-sizeof(terror));
|
||||||
end;
|
end;
|
||||||
{**********************************************************************
|
{**********************************************************************
|
||||||
Variant manager functions
|
Variant manager functions
|
||||||
|
@ -253,7 +253,7 @@ operator :=(const source : comp) dest : variant;{$ifdef SYSTEMINLINE}inline;{$en
|
|||||||
{ Misc. }
|
{ Misc. }
|
||||||
operator :=(const source : currency) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : currency) dest : variant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
operator :=(const source : tdatetime) 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
|
from Variant assignments
|
||||||
@ -303,7 +303,7 @@ operator :=(const source : variant) dest : olevariant;{$ifdef SYSTEMINLINE}inlin
|
|||||||
{ Misc. }
|
{ Misc. }
|
||||||
operator :=(const source : variant) dest : currency;{$ifdef SYSTEMINLINE}inline;{$endif}
|
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 : 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
|
Operators
|
||||||
@ -378,7 +378,7 @@ operator :=(const source : olevariant) dest : comp;{$ifdef SYSTEMINLINE}inline;{
|
|||||||
{ Misc. }
|
{ Misc. }
|
||||||
operator :=(const source : olevariant) dest : currency;{$ifdef SYSTEMINLINE}inline;{$endif}
|
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 : 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
|
to OLEVariant assignments
|
||||||
@ -425,7 +425,7 @@ operator :=(const source : comp) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{
|
|||||||
{ Misc. }
|
{ Misc. }
|
||||||
operator :=(const source : currency) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
operator :=(const source : currency) dest : olevariant;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
operator :=(const source : tdatetime) 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
|
OLEVariant Operators
|
||||||
|
Loading…
Reference in New Issue
Block a user