Das ganze ist eigentlich recht gut beschrieben auf der Internetseite - aber wenns denn unbedingt sein muss:


// das muss oben irgendwo hin. am besten über "implememtation"

procedure PortOut(Port : Word; Data : Byte); stdcall; external 'io.dll';
procedure PortWordOut(Port : Word; Data : Word); stdcall; external 'io.dll';
procedure PortDWordOut(Port : Word; Data : DWord); stdcall; external 'io.dll';
function PortIn(Port : Word) : Byte; stdcall; external 'io.dll';
function PortWordIn(Port : Word) : Word; stdcall; external 'io.dll';
function PortDWordIn(Port : Word) : DWord; stdcall; external 'io.dll';
procedure SetPortBit(Port : Word; Bit : Byte); stdcall; external 'io.dll';
procedure ClrPortBit(Port : Word; Bit : Byte); stdcall; external 'io.dll';
procedure NotPortBit(Port : Word; Bit : Byte); stdcall; external 'io.dll';
function GetPortBit(Port : Word; Bit : Byte) : WordBool; stdcall; external 'io.dll';
function RightPortShift(Port : Word; Val : WordBool) : WordBool; stdcall; external 'io.dll';
function LeftPortShift(Port : Word; Val : WordBool) : WordBool; stdcall; external 'io.dll';
function IsDriverInstalled : Boolean; stdcall; external 'io.dll';

// bei Form.OnCreate oder sonstwo:
if not IsDriverInstalled then
begin
Showmessage('io.dll konnte nicht geladen werden!');
halt;
end;

// die kleine Hilfsfunktion sollte unter implementation sein

Function MakeByte(bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7:b yte):byte;
begin
result:=bit0*1 or bit1*2 or bit2*4 or bit3*8 or bit4*16 or bit5*32 or bit6*64 or bit7*128;
end;

// damit macht man setzt man die einzelnen bits:
// $0378 ist die Daten-Adresse vom LPT1 (im normalfall)

PortOut($0378,MakeByte(1,0,1,0,1,0,1,0));

//natürlich geht das auch mit SetPortBit oder ClrPortBit oder NotPortBit oder ...

Ich hoffe jetzt ist das alles sonnenklar! ...

MfG Alex