TV2Request =
record
RequestType: TV2RequestType;
Res: integer;
URL:
string;
LocalFile:
string;
HTTPContent:
string;
RequestVars: TStringList;
end;
PV2Request = ^TV2Request;
TFormHTTPV2 =
class(TForm)
private
FV2Requests:
array of TV2Request;
function GetItem(x: integer): PV2Request;
function GetItemCount: integer;
public
procedure ClearItems;
property ItemCount: integer
read GetItemCount;
property Items[x: integer]: PV2Request
read GetItem;
end;
procedure TFormHTTPV2.ClearItems;
begin
SetLength(FV2Requests, 0);
end;
function TFormHTTPV2.GetItem(x: integer): PV2Request;
begin
if (x >= 0)
and (x <= High(FV2Requests))
then
begin
Result := @FV2Requests[x];
exit;
end;
SetLength(FV2Requests, Length(FV2Requests) + 1);
FillChar(FV2Requests[High(FV2Requests)], SizeOf(TV2Request), 0);
Result := @FV2Requests[High(FV2Requests)];
Result.RequestVars := TStringList.create;
end;
function TFormHTTPV2.GetItemCount: integer;
begin
Result := length(FV2Requests);
end;