diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index 5447a56df0..5c51b92855 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -1322,7 +1322,7 @@ begin if (BaseDir<>'') then for i:=0 to Result.Count-1 do begin Filename:=Result[i]; - Filename:=copy(Filename,BaseDirLen+1,length(Filename)); + delete(Filename,1,BaseDirLen); if (Filename<>'') and (Filename[1]=PathDelim) then System.Delete(Filename,1,1); Result[i]:=Filename; diff --git a/components/lazcontrols/treefilteredit.pas b/components/lazcontrols/treefilteredit.pas index a85ed61bcb..5ba022953e 100644 --- a/components/lazcontrols/treefilteredit.pas +++ b/components/lazcontrols/treefilteredit.pas @@ -283,10 +283,10 @@ begin p:=0; while Filename<>'' do begin // get the next file name part - DelimPos:=System.Pos(PathDelim,Filename); + DelimPos:=Pos(PathDelim,Filename); if DelimPos>0 then begin FilePart:=copy(Filename,1,DelimPos-1); - Filename:=copy(Filename,DelimPos+1,length(Filename)); + delete(Filename,1,DelimPos); end else begin FilePart:=Filename; Filename:=''; diff --git a/components/synedit/syneditautocomplete.pp b/components/synedit/syneditautocomplete.pp index 26a5f9e99c..ca182cd9b5 100644 --- a/components/synedit/syneditautocomplete.pp +++ b/components/synedit/syneditautocomplete.pp @@ -416,7 +416,7 @@ procedure TCustomSynAutoComplete.ParseCompletionList; if (iPattern[i]) then inc(i); - Pattern:=copy(Pattern,i+1,length(Pattern)); + delete(Pattern,1,i); end; var diff --git a/converter/convertdelphi.pas b/converter/convertdelphi.pas index f1611b5f10..869965f933 100644 --- a/converter/convertdelphi.pas +++ b/converter/convertdelphi.pas @@ -1622,9 +1622,9 @@ begin DebugLn('TConvertDelphiProject.FindAllUnits: '+lisConvDelphiFoundAllUnitFiles); for i:=0 to FoundUnits.Count-1 do begin CurFilename:=FoundUnits[i]; - p:=System.Pos(' in ',CurFilename); + p:=Pos(' in ',CurFilename); if p>0 then - CurFilename:=copy(CurFilename,p+4,length(CurFilename)); + delete(CurFilename,1,p+3); if CurFilename='' then continue; Result:=AddUnit(SwitchPathDelims(CurFilename, True), ui); if Result=mrAbort then @@ -1930,7 +1930,7 @@ begin CurFilename:=FoundUnits[i]; p:=System.Pos(' in ',CurFilename); if p>0 then - CurFilename:=copy(CurFilename,p+4,length(CurFilename)); + delete(CurFilename,1,p+3); if CurFilename='' then continue; Result:=AddUnit(SwitchPathDelims(CurFilename, True)); if Result=mrAbort then diff --git a/ide/buildprojectdlg.pas b/ide/buildprojectdlg.pas index 620ac815ac..977a4a7349 100644 --- a/ide/buildprojectdlg.pas +++ b/ide/buildprojectdlg.pas @@ -435,7 +435,7 @@ begin p:=System.Pos('/',aTVPath); if p>0 then begin NodeText:=copy(aTVPath,1,p-1); - aTVPath:=Copy(aTVPath,p+1,length(aTVPath)); + Delete(aTVPath,1,p); end else begin NodeText:=aTVPath; end; diff --git a/ide/codecontextform.pas b/ide/codecontextform.pas index c288a0ec78..301249cf5e 100644 --- a/ide/codecontextform.pas +++ b/ide/codecontextform.pas @@ -1027,7 +1027,7 @@ procedure TCodeContextFrm.CompleteParameters(DeclCode: string); dec(Indent,CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.Indent); NewCode:=CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.BeautifyStatement( NewCode,Indent,[],X); - NewCode:=copy(NewCode,Indent+1,length(NewCode)); + delete(NewCode,1,Indent); if NewCode='' then begin ShowMessage(lisAllParametersOfThisFunctionAreAlreadySetAtThisCall); exit; diff --git a/ide/editorfilemanager.pas b/ide/editorfilemanager.pas index 6a5ad2855d..ac64184427 100644 --- a/ide/editorfilemanager.pas +++ b/ide/editorfilemanager.pas @@ -370,7 +370,7 @@ var begin s:=CheckListBox1.Items[ListIndex]; if (s<>'') and (s[1]='*') then // Modified indicator - s:=copy(s, 3, Length(s)); + delete(s, 1, 2); Result:=SourceEditorManager.SourceEditorIntfWithFilename(s); end; diff --git a/ide/findrenameidentifier.pas b/ide/findrenameidentifier.pas index 25ea55bff1..3a8227670f 100644 --- a/ide/findrenameidentifier.pas +++ b/ide/findrenameidentifier.pas @@ -447,7 +447,7 @@ var if p<1 then exit; PackageName:=copy(Link,2,p-2); if SysUtils.CompareText(PackageName,OldPackageName)<>0 then exit; - Link:=copy(Link,p+1,length(Link)); + delete(Link,1,p); end; if (SysUtils.CompareText(Link,OldElementName)=0) or (SysUtils.CompareText(Link,OldModuleName+'.'+OldElementName)=0) then diff --git a/ide/main.pp b/ide/main.pp index 1209e72e7f..a8da1ce8f2 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -12237,7 +12237,7 @@ begin if i>0 then begin i:=PosEx(' ', PropDetails, i+1); if i>0 then - PropDetails:=Copy(PropDetails, i+1, Length(PropDetails)); + Delete(PropDetails, 1, i); end; OI.StatusBar.SimpleText:=PropDetails; // Show in OI StatusBar end; diff --git a/ide/project.pp b/ide/project.pp index d7f8b4687d..612fb045a5 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -4051,7 +4051,7 @@ begin else begin CurPath:=copy(ExtractFilePath(Result),1,length(BaseDir)); if CompareFilenames(BaseDir,CurPath)=0 then - Result:=copy(Result,length(CurPath)+1,length(Result)); + delete(Result,1,length(CurPath)); end; end; diff --git a/lcl/include/fpimagebitmap.inc b/lcl/include/fpimagebitmap.inc index bedf7b015e..c78a26e446 100644 --- a/lcl/include/fpimagebitmap.inc +++ b/lcl/include/fpimagebitmap.inc @@ -89,8 +89,8 @@ begin Extensions:=GetFileExtensions; if Extensions='' then exit; Ext:=FileExtension; - if Ext[1]='.' then begin - Ext:=copy(Ext,2,length(Ext)); + if Ext[1]='.' then begin + delete(Ext,1,1); if Ext='' then exit; end; StartPos:=1;