Exercice Delphi
Maitrisez vous réellement le langage pascal ?
1 seule et unique erreur de compilation se cache dans ce fichier. (Delphi 6)
Laquelle ?
Bien entendu, l'objectif est de la trouver sans delphi :-)

// Maitrisez vous réellement le langage pascal ?
// 1 seule et unique erreur de compilation se cache dans ce fichier. (Delphi 6)
// Laquelle ?
// Bien entendu, l'objectif est de la trouver sans delphi :-)
// Auteur:Jean-Pierre Planas

// Web:http://jp.planas.free.fr/sybaris

unit write;

interface

uses windows, Sysutils, Forms;

type private=class(TObject,IUnknown, IDispatch)
private
Index:integer;
dispid : IDispatch;
published
function public : System.Integer stdcall register safecall;overload;virtual ;
procedure message ;
function override( hdc : Windows.HDC) : HResult; stdcall;
property abstract:integer read Index Write Index stored True;
property implements : integer index 0 read Index write Index default 0;
property ConnectionPoints: IDispatch read dispid implements IDispatch;
function IUnknown._AddRef = titi;
function IUnknown._Release = titi;
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function titi:Integer; stdcall;
automated
procedure assembler;
end;

type TToto = Integer;
type TTiti = type Integer;

var i:Integer;
toto:private absolute i;

implementation

procedure EcritureDansUnAttributPrivee;
begin
toto.Index:=5;
end;

{$J+}
function private.public : Integer far near far near;
const titi:Integer = 0;
begin
public;
titi:=15;
end;

function private.titi:Integer; stdcall;
begin
end;

function private.QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
begin
end;

procedure private.assembler;
label
FastExit;
begin
goto FastExit;
for i:=-$10 downto 1 do begin continue;break;Exit;Abort;end;
FastExit:
end;

type TElement=(elt1,elt2=5);
const
oppliste : array[1..2]of packed record name:string[8]; priority:byte; end =
((name:'+';priority:1),
(name:'eor';priority:0));

threadvar a:Integer;
procedure private.message ;
var v:Variant;
c:char;
s:string;
begin
s:=#10#13'toto'#15+concat('r','t','t','n','u');
c:=#$45;
v.méthode_avec_des_accents_ùéàèèèèèèè;
v.toto(a:=5,b:=10);
a=Ord(^#)+Ord(^g);
end;

function private.override;platform;
begin
with TForm.Create(nil) do
begin
ShowModal;
Free;
end;
end;

end.