mydata
Delphi Low High
.
mydata
succ pred, .
-
...
array of double, .
writeToFile :
procedure writeArrayToFile(const AFileName : string; const writeData : array of double);
var
i: integer;
begin
for i:= low(writeData) to High(writeData) do begin
WriteADoubleToFile(AFilename, writeData[i]);
end; {for i}
end;
const, , , .
, :
procedure TDatStruct.writeToFile(const AFileName : string);
begin
WriteArrayToFile(FileName, GetMyData^);
end;
, TDatStruct , , .
type
TMyArray = array[0..0] of double;
PMyArray = ^TMyArray;
.....
TDatStruct = class
protected
function GetMyData: PMyArray; virtual; abstract;
public
procedure WriteToFile(const Filename: string);
end;
WriteArrayToFile .
, writeToFile " ", , .
(double/string ..).
.
? ?
.
, .
, Ord.
256 . , , .
function FixedArrayToDynamicArray(const input: array of double): TArray<double>;
begin
SetLength(Result, High(input));
Move(input[0], Result[0], SizeOf(Double) * High(input));
end;
pre-generics :
type
TDoubleArray = array of double;
function FixedArrayToDynamicArray(const input: array of double): TDoubleArray;
... same from here on.