Ich habs nun mal so gemacht. Muss nur noch testen. Das Array ar4 enthält dann die 4 Bytes, unabhängig, ob es Single, LongWord oder LongInt ist.
Delphi-Quellcode:
Function WriteToSvr(Address: Longword; dValue: Longword): Boolean; overload;
var
Adr1 : Longword;
Wert : Longword;
ar: ar4 absolute Wert;
begin
Result := False;
Adr1 := Address;
Wert := dValue;
If WriteToSvr3(Adr1, ar) then begin
Result := True;
end;
end;
Function WriteToSvr(Address: Longword; dValue: LongInt): Boolean; overload;
var
Adr1 : Longword;
Wert : LongInt;
ar: ar4 absolute Wert;
begin
Result := False;
Adr1 := Address;
Wert := dValue;
If WriteToSvr3(Adr1, ar) then begin
Result := True;
end;
end;
Function WriteToSvr(Address: Longword; dValue: Single): Boolean; overload;
var
Adr1 : Longword;
Wert : Single;
ar: ar4 absolute Wert;
begin
Result := False;
Adr1 := Address;
Wert := dValue;
If WriteToSvr3(Adr1, ar) then begin
Result := True;
end;
end;