Delete (arr [x], 1, I);
//showmessage (arr [x]).
FPstr:=arr [x];
Showmessage (FPstr);
CodePudding user response:
Arr is a dynamic array, when the third time to delete, can't show the arr of string, and error is the access violation at address this error, ask how to solve?CodePudding user response:
Can have a great god helpCodePudding user response:
If the arr is two-dimensional dynamic array, the Delete (arr [x], 1, I); Is deleted by the first character of X d, I character,You did not say or check arr the length of the [x], delete the third time, arr [x] may be removed, certainly there will be access violation at address.
CodePudding user response:
No problem with the code basic
Var arr: an array of String;
I, j: integer;
The begin
SetLength (arr. 10);
For I:=0 to 9 do
Arr: [I]='12345678901234567890123456789012345678901234567890';
I:=5;
For j:=0 to 9 do
Delete (arr [j] 1, I);
For j:=0 to 9 do
Delete (arr [j] 1, I);
For j:=0 to 9 do
Delete (arr [j] 1, I);
Showmessage (arr [0]);
The end;
All the executable,
Dynamic array errors, whether your address references there are any errors, set the length of the 10, reference 0-9,
CodePudding user response:
Crossing the line to delete and effectiveness when used to determine the subscript