Wonder, how can delete part of the record? Masters to help you, online, etc., very anxious!
Type
TprocessReceive=record
FSTR: string [30];
Fld_flagyzm: integer;
end;
ArrayprocessReceive: an Array of TprocessReceive;
CodePudding user response:
There is no answer, please top yourself!CodePudding user response:
If you are new then dispose offCodePudding user response:
But I this is not ah!CodePudding user response:
Dynamic array can use Move functionSetLength again
CodePudding user response:
This may use TList management convenient pointCodePudding user response:
procedure TForm3. Add;
The begin
Inc (Count);
SetLength (ArrayprocessReceive, Count);
FSTR ArrayprocessReceive [Count - 1]='s' + IntToStr (Count);
Fld_flagyzm ArrayprocessReceive [Count - 1]=Count;
end;
Procedure TForm3. Del (const index: Integer);
The begin
If (Index & lt; 0) or (Index & gt;=Count) then
Raise the Exception. The Create (' Argument out of range);
Dec (Count);
If the index & lt;> The Count then
The begin
ArrayprocessReceive Move (ArrayprocessReceive [index + 1], [index], (the Count - index) * SizeOf (TprocessReceive));
SetLength (ArrayprocessReceive, Count);
end;
end;
Procedure TForm3. Btn1Click (Sender: TObject);
The begin
The Add;
end;
Procedure TForm3. Btn2Click (Sender: TObject);
The begin
Del (0);
end;
Procedure TForm3. FormCreate (Sender: TObject);
The begin
Count:=0;
end;
CodePudding user response:
This structure into a class, and then use TObjectList
USES the
Generics. Collections;
Type
TProcessReceive=class (TObject)
Private
FstrMsg: string;
Ffld_flagyzm: Integer;
Procedure Setfld_flagyzm (const Value: Integer);
Procedure SetstrMsg (const Value: string);
Protected
Public
The constructor Create;
The destructor Destroy; Override.
Published
The property strMsg: string read FstrMsg write SetstrMsg;
The property fld_flagyzm: Integer read Ffld_flagyzm write Setfld_flagyzm;
end;
Var
ObjList: TObjectList;//use generics to management,
CodePudding user response:
TObjectListCodePudding user response:
Memory table can also ah,