Procedure et procedure (TObjet) Aide svp
Bonjour,
Mon problème est le suivant: j'ai une procédure simple non "objet" qui doit faire appel à une procédure (ASender: TObject). J'ai ajouté le nom de la "form"suivi d'un point, D7 ne détecte pas d'erreur à la compilation, mais donne une erreur lors de l’exécution. voici une partie du code:
Merci d'avance pour votre aide.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| var
FormPhidget: TFormPhidget;
//AdressIp : string[16];
//portChar : integer;
IO : ARRAY[1..MaxIOchannel] OF Boolean;
DAC : ARRAY[1..MaxDACchannel] OF Integer;
AD : ARRAY[1..MaxADchannel] OF Integer;
DA : ARRAY[1..MaxDAchannel] OF Integer;
InputDevice :ARRAY[1..MaxIOchannel] OF TIOdevice;
OutputDevice:ARRAY[1..MaxIOchannel] OF TIOdevice;
NumPhidgetInterfaceKit: byte;
PROCEDURE SetIOchannel(Channel_no: TIOchannel);
PROCEDURE ClearIOchannel(Channel_no: TIOchannel);
{6 BIT DAC CONVERTER PROCEDURES}
PROCEDURE OutputDACchannel(Channel_no: TDACchannel ; Data: Integer);
PROCEDURE ClearDACchannel(Channel_no: TDACchannel);
PROCEDURE SetDACchannel(Channel_no: TDACchannel);
implementation
{$R *.dfm}
{ Set one IO channel and update the 'IOdata' & 'IO' array.
--------------------------------------------------------
}
procedure TFormPhidget.SetIoChanelClick(Sender: TObject);
begin
SetIOchannel(10);
end;
PROCEDURE SetIOchannel(Channel_no: TIOchannel);
var
I, X, Y: byte;
BEGIN
{Calculate module no}
for I:=1 to 6 do begin
if (OutputDevice[I].Actif) and (Channel_no >= OutputDevice[I].StartIO)
and (Channel_no >= OutputDevice[I].EndIO) then
begin
X:=OutputDevice[I].Module;
Y:=Channel_no-OutputDevice[I].StartIO-1;
:fleche: TPhidgetInterfaceKit(FormPhidget.findComponent('PhidgetInterfaceKit'
+IntToStr(X))).OutputState[Y]:=true;
{Data for correct IOchannel to set}
IO[Channel_no]:=true;
:fleche: FormPhidget.Memo1.Lines.Add('IO['+IntToStr(Channel_no)+'] = true');
end;
end;
{Set IOchannel}
END; |