refact, omit def member

This commit is contained in:
Basile Burg 2016-01-31 14:39:50 +01:00
parent 816c581d7a
commit 767e315164
21 changed files with 87 additions and 88 deletions

View File

@ -533,8 +533,8 @@ var
begin begin
for i:= 0 to sPaths.Count-1 do for i:= 0 to sPaths.Count-1 do
begin begin
str := sPaths.Strings[i]; str := sPaths[i];
sPaths.Strings[i] := patchPlateformPath(str); sPaths[i] := patchPlateformPath(str);
end; end;
end; end;
@ -990,7 +990,7 @@ begin
try try
sink.Assign(someFiles); sink.Assign(someFiles);
for i := sink.Count-1 downto 0 do for i := sink.Count-1 downto 0 do
if (not sink.Strings[i].fileExists) and (not sink.Strings[i].dirExists) then if (not sink[i].fileExists) and (not sink[i].dirExists) then
sink.Delete(i); sink.Delete(i);
// folders count // folders count
cnt := 256; cnt := 256;
@ -1002,25 +1002,25 @@ begin
end; end;
for i := sink.Count-1 downto 0 do for i := sink.Count-1 downto 0 do
begin begin
while (countFolder(sink.Strings[i]) <> cnt) do while (countFolder(sink[i]) <> cnt) do
sink.Strings[i] := ExtractFileDir(sink.Strings[i]); sink[i] := ExtractFileDir(sink[i]);
end; end;
// common folder // common folder
while(true) do while(true) do
begin begin
for i := sink.Count-1 downto 0 do for i := sink.Count-1 downto 0 do
begin begin
dir := ExtractFileDir(sink.Strings[i]); dir := ExtractFileDir(sink[i]);
j := sink.IndexOf(dir); j := sink.IndexOf(dir);
if j = -1 then if j = -1 then
sink.Strings[i] := dir sink[i] := dir
else if j <> i then else if j <> i then
sink.Delete(i); sink.Delete(i);
end; end;
if sink.Count = 1 then if sink.Count = 1 then
break; break;
end; end;
result := sink.Strings[0]; result := sink[0];
finally finally
sink.free; sink.free;
end; end;
@ -1154,7 +1154,7 @@ begin
if str = nil then exit; if str = nil then exit;
for i:= str.Count-1 downto 0 do for i:= str.Count-1 downto 0 do
// if less than 0 -> not found -> unsigned -> greater than current index. // if less than 0 -> not found -> unsigned -> greater than current index.
if cardinal(str.IndexOf(str.Strings[i])) < i then if cardinal(str.IndexOf(str[i])) < i then
str.Delete(i); str.Delete(i);
{$HINTS ON} {$HINTS ON}
end; end;

View File

@ -131,7 +131,7 @@ begin
inherited; inherited;
ctrl := TCEPageControl(owner); ctrl := TCEPageControl(owner);
i := ctrl.getPageIndex(self); i := ctrl.getPageIndex(self);
if i <> -1 then ctrl.fTabs.Tabs.Strings[i] := caption; if i <> -1 then ctrl.fTabs.Tabs[i] := caption;
end; end;
constructor TCEPageControl.Create(aowner: TComponent); constructor TCEPageControl.Create(aowner: TComponent);
@ -269,7 +269,7 @@ begin
if (index < 0) or (index > fPages.Count-1) then if (index < 0) or (index > fPages.Count-1) then
exit; exit;
pge := TCEPage(fPages.Items[index]); pge := TCEPage(fPages[index]);
pge.Visible:=false; pge.Visible:=false;
end; end;
@ -281,7 +281,7 @@ begin
if (index < 0) or (index > fPages.Count-1) then if (index < 0) or (index > fPages.Count-1) then
exit; exit;
pge := TCEPage(fPages.Items[index]); pge := TCEPage(fPages[index]);
if (fSplittedPageIndex = -1) or (index = fSplittedPageIndex) then if (fSplittedPageIndex = -1) or (index = fSplittedPageIndex) then
pge.Align:=alClient; pge.Align:=alClient;
pge.Visible:=true; pge.Visible:=true;
@ -359,7 +359,7 @@ begin
else if index < fSplittedPageIndex then else if index < fSplittedPageIndex then
fSplittedPageIndex -= 1; fSplittedPageIndex -= 1;
TCEPage(fPages.Items[index]).Free; TCEPage(fPages[index]).Free;
if fPageIndex >= fPages.Count then if fPageIndex >= fPages.Count then
fPageIndex -= 1; fPageIndex -= 1;
@ -383,7 +383,7 @@ begin
if (fPageIndex < 0) or (fPageIndex > fPages.Count-1) then if (fPageIndex < 0) or (fPageIndex > fPages.Count-1) then
exit(nil) exit(nil)
else else
exit(TCEPage(fPages.Items[fPageIndex])); exit(TCEPage(fPages[fPageIndex]));
end; end;
procedure TCEPageControl.setCurrentPage(value: TCEPage); procedure TCEPageControl.setCurrentPage(value: TCEPage);
@ -398,7 +398,7 @@ end;
function TCEPageControl.getPage(index: integer): TCEPage; function TCEPageControl.getPage(index: integer): TCEPage;
begin begin
exit(TCEPage(fPages.Items[index])); exit(TCEPage(fPages[index]));
end; end;
function TCEPageControl.getSplitPage: TCEPage; function TCEPageControl.getSplitPage: TCEPage;

View File

@ -275,7 +275,7 @@ begin
updateServerlistening; updateServerlistening;
exit; exit;
end; end;
if not (fTempLines.Strings[0] = 'calltips') then exit; if not (fTempLines[0] = 'calltips') then exit;
// //
fTempLines.Delete(0); fTempLines.Delete(0);
tips := fTempLines.Text; tips := fTempLines.Text;
@ -306,12 +306,12 @@ begin
updateServerlistening; updateServerlistening;
exit; exit;
end; end;
if not (fTempLines.Strings[0] = 'identifiers') then exit; if not (fTempLines[0] = 'identifiers') then exit;
// //
aList.Clear; aList.Clear;
for i := 1 to fTempLines.Count-1 do for i := 1 to fTempLines.Count-1 do
begin begin
item := fTempLines.Strings[i]; item := fTempLines[i];
kind := item[item.length]; kind := item[item.length];
setLength(item, item.length-2); setLength(item, item.length-2);
case kind of case kind of

View File

@ -208,8 +208,7 @@ begin
loader.Position:= 0; loader.Position:= 0;
// //
FreeAndNil(fJSON); FreeAndNil(fJSON);
parser := TJSONParser.Create(loader, true); parser := TJSONParser.Create(loader, [joIgnoreTrailingComma, joUTF8]);
parser.Options:= parser.Options + [joIgnoreTrailingComma] - [joStrict];
//TODO-cfcl-json: remove etc/fcl-json the day they'll merge and rlz the version with 'Options' //TODO-cfcl-json: remove etc/fcl-json the day they'll merge and rlz the version with 'Options'
//TODO-cfcl-json: track possible changes and fixes at http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-json/ //TODO-cfcl-json: track possible changes and fixes at http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-json/
try try
@ -268,9 +267,9 @@ begin
try try
str.Add('dub' + exeExt); str.Add('dub' + exeExt);
str.Add('build'); str.Add('build');
str.Add('--build=' + fBuildTypes.Strings[fBuiltTypeIx]); str.Add('--build=' + fBuildTypes[fBuiltTypeIx]);
if (fConfigs.Count <> 1) and (fConfigs.Strings[0] <> DubDefaultConfigName) then if (fConfigs.Count <> 1) and (fConfigs[0] <> DubDefaultConfigName) then
str.Add('--config=' + fConfigs.Strings[fConfigIx]); str.Add('--config=' + fConfigs[fConfigIx]);
str.Add('--compiler=' + DubCompilerFilename); str.Add('--compiler=' + DubCompilerFilename);
result := str.Text; result := str.Text;
finally finally
@ -302,14 +301,14 @@ end;
function TCEDubProject.sourceRelative(index: integer): string; function TCEDubProject.sourceRelative(index: integer): string;
begin begin
exit(fSrcs.Strings[index]); exit(fSrcs[index]);
end; end;
function TCEDubProject.sourceAbsolute(index: integer): string; function TCEDubProject.sourceAbsolute(index: integer): string;
var var
fname: string; fname: string;
begin begin
fname := fSrcs.Strings[index]; fname := fSrcs[index];
if fname.fileExists then if fname.fileExists then
result := fname result := fname
else else
@ -323,7 +322,7 @@ end;
function TCEDubProject.importPath(index: integer): string; function TCEDubProject.importPath(index: integer): string;
begin begin
result := expandFilenameEx(fBasePath, fImportPaths.Strings[index]); result := expandFilenameEx(fBasePath, fImportPaths[index]);
end; end;
{$ENDREGION --------------------------------------------------------------------} {$ENDREGION --------------------------------------------------------------------}
@ -349,8 +348,8 @@ end;
function TCEDubProject.configurationName(index: integer): string; function TCEDubProject.configurationName(index: integer): string;
begin begin
result := fBuildTypes.Strings[index div fConfigs.Count] + ' - ' + result := fBuildTypes[index div fConfigs.Count] + ' - ' +
fConfigs.Strings[index mod fConfigs.Count]; fConfigs[index mod fConfigs.Count];
end; end;
{$ENDREGION --------------------------------------------------------------------} {$ENDREGION --------------------------------------------------------------------}
@ -438,9 +437,9 @@ begin
fDubProc.Parameters.Add('run'); fDubProc.Parameters.Add('run');
fDubProc.OnTerminate:= @dubProcOutput; fDubProc.OnTerminate:= @dubProcOutput;
end; end;
fDubProc.Parameters.Add('--build=' + fBuildTypes.Strings[fBuiltTypeIx]); fDubProc.Parameters.Add('--build=' + fBuildTypes[fBuiltTypeIx]);
if (fConfigs.Count <> 1) and (fConfigs.Strings[0] <> DubDefaultConfigName) then if (fConfigs.Count <> 1) and (fConfigs[0] <> DubDefaultConfigName) then
fDubProc.Parameters.Add('--config=' + fConfigs.Strings[fConfigIx]); fDubProc.Parameters.Add('--config=' + fConfigs[fConfigIx]);
fDubProc.Parameters.Add('--compiler=' + DubCompilerFilename); fDubProc.Parameters.Add('--compiler=' + DubCompilerFilename);
if run and runArgs.isNotEmpty then if run and runArgs.isNotEmpty then
fDubProc.Parameters.Add('--' + runArgs); fDubProc.Parameters.Add('--' + runArgs);

View File

@ -446,7 +446,7 @@ begin
len := getLineEndingLength(fDoc.fileName); len := getLineEndingLength(fDoc.fileName);
for i := 0 to fDoc.Lines.Count-1 do for i := 0 to fDoc.Lines.Count-1 do
begin begin
linelen := fDoc.Lines.Strings[i].length; linelen := fDoc.Lines[i].length;
if sum + linelen + len > srcpos then if sum + linelen + len > srcpos then
begin begin
fDoc.CaretY := i + 1; fDoc.CaretY := i + 1;

View File

@ -228,8 +228,8 @@ begin
for i:= 0 to ed.Keystrokes.Count-1 do for i:= 0 to ed.Keystrokes.Count-1 do
begin begin
shc := TCEPersistentShortcut(fShortCuts.Add); shc := TCEPersistentShortcut(fShortCuts.Add);
shc.actionName:= EditorCommandToCodeString(ed.Keystrokes.Items[i].Command); shc.actionName:= EditorCommandToCodeString(ed.Keystrokes[i].Command);
shc.shortcut := ed.Keystrokes.Items[i].ShortCut; shc.shortcut := ed.Keystrokes[i].ShortCut;
end; end;
finally finally
ed.free; ed.free;

View File

@ -335,7 +335,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEMultiDocObserver).docNew(aDoc); (fObservers[i] as ICEMultiDocObserver).docNew(aDoc);
end; end;
procedure subjDocClosing(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo); procedure subjDocClosing(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo);
@ -343,7 +343,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEMultiDocObserver).docClosing(aDoc); (fObservers[i] as ICEMultiDocObserver).docClosing(aDoc);
end; end;
procedure subjDocFocused(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo); procedure subjDocFocused(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo);
@ -351,7 +351,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEMultiDocObserver).docFocused(aDoc); (fObservers[i] as ICEMultiDocObserver).docFocused(aDoc);
end; end;
procedure subjDocChanged(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo); procedure subjDocChanged(aSubject: TCEMultiDocSubject; aDoc: TCESynMemo);
@ -359,7 +359,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEMultiDocObserver).docChanged(aDoc); (fObservers[i] as ICEMultiDocObserver).docChanged(aDoc);
end; end;
{$ENDREGION} {$ENDREGION}
@ -369,7 +369,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).ProjNew(aProj); (fObservers[i] as ICEProjectObserver).ProjNew(aProj);
end; end;
procedure subjProjClosing(aSubject: TCEProjectSubject; aProj: ICECommonProject); procedure subjProjClosing(aSubject: TCEProjectSubject; aProj: ICECommonProject);
@ -377,7 +377,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).projClosing(aProj); (fObservers[i] as ICEProjectObserver).projClosing(aProj);
end; end;
procedure subjProjFocused(aSubject: TCEProjectSubject; aProj: ICECommonProject); procedure subjProjFocused(aSubject: TCEProjectSubject; aProj: ICECommonProject);
@ -385,7 +385,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).projFocused(aProj); (fObservers[i] as ICEProjectObserver).projFocused(aProj);
end; end;
procedure subjProjChanged(aSubject: TCEProjectSubject; aProj: ICECommonProject); procedure subjProjChanged(aSubject: TCEProjectSubject; aProj: ICECommonProject);
@ -393,7 +393,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).projChanged(aProj); (fObservers[i] as ICEProjectObserver).projChanged(aProj);
end; end;
procedure subjProjCompiling(aSubject: TCEProjectSubject; aProj: ICECommonProject); procedure subjProjCompiling(aSubject: TCEProjectSubject; aProj: ICECommonProject);
@ -401,7 +401,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).projCompiling(aProj); (fObservers[i] as ICEProjectObserver).projCompiling(aProj);
end; end;
procedure subjProjCompiled(aSubject: TCEProjectSubject; aProj: ICECommonProject; success: boolean); procedure subjProjCompiled(aSubject: TCEProjectSubject; aProj: ICECommonProject; success: boolean);
@ -409,7 +409,7 @@ var
i: Integer; i: Integer;
begin begin
with aSubject do for i:= 0 to fObservers.Count-1 do with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICEProjectObserver).projCompiled(aProj, success); (fObservers[i] as ICEProjectObserver).projCompiled(aProj, success);
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -186,9 +186,9 @@ begin
listFiles(lst, dir); listFiles(lst, dir);
for j:= 0 to lst.Count-1 do for j:= 0 to lst.Count-1 do
begin begin
if lst.Strings[j].extractFileExt = libExt then if lst[j].extractFileExt = libExt then
if aList.IndexOf(lst.Strings[j]) = -1 then if aList.IndexOf(lst[j]) = -1 then
aList.Add(lst.Strings[j]); aList.Add(lst[j]);
end; end;
finally finally
lst.Free; lst.Free;

View File

@ -275,7 +275,7 @@ begin
Caption := nme; Caption := nme;
SubItems.Add(prj.outputFilename); SubItems.Add(prj.outputFilename);
if str.Count = 1 then if str.Count = 1 then
cdy := ExtractFileDir(str.Strings[0]) cdy := ExtractFileDir(str[0])
else begin else begin
cdy := commonFolder(str); cdy := commonFolder(str);
cdy := ExtractFileDir(cdy); cdy := ExtractFileDir(cdy);
@ -367,7 +367,7 @@ begin
str.Add(fProj.sourceAbsolute(i)); str.Add(fProj.sourceAbsolute(i));
// single source libs usually have the structure "src/<fname>" // single source libs usually have the structure "src/<fname>"
if str.Count = 1 then if str.Count = 1 then
root := ExtractFileDir(str.Strings[0]) root := ExtractFileDir(str[0])
// multi source libs have the structure "src/LibName/<fname>"/... // multi source libs have the structure "src/LibName/<fname>"/...
else begin else begin
root := commonFolder(str); root := commonFolder(str);
@ -558,9 +558,9 @@ begin
begin begin
itm := TLibraryItem(LibMan.libraries.Add); itm := TLibraryItem(LibMan.libraries.Add);
itm.libAlias := row.Caption; itm.libAlias := row.Caption;
itm.libFile := row.SubItems.Strings[0]; itm.libFile := row.SubItems[0];
itm.libSourcePath := row.SubItems.Strings[1]; itm.libSourcePath := row.SubItems[1];
itm.projectFile:= row.SubItems.Strings[2]; itm.projectFile:= row.SubItems[2];
end; end;
LibMan.libraries.EndUpdate; LibMan.libraries.EndUpdate;
LibMan.updateDCD; LibMan.updateDCD;

View File

@ -622,7 +622,7 @@ begin
// //
for i := 0 to fDocuments.Count-1 do for i := 0 to fDocuments.Count-1 do
begin begin
str := fDocuments.Strings[i]; str := fDocuments[i];
if str.fileExists then if str.fileExists then
begin begin
docHandler.openDocument(str); docHandler.openDocument(str);
@ -1298,7 +1298,7 @@ begin
for i:= 0 to srcLst.Count-1 do for i:= 0 to srcLst.Count-1 do
begin begin
fname := srcLst.Strings[i]; fname := srcLst[i];
itm := TMenuItem.Create(trgMnu); itm := TMenuItem.Create(trgMnu);
itm.Hint := fname; itm.Hint := fname;
itm.Caption := shortenPath(fname, 50); itm.Caption := shortenPath(fname, 50);
@ -1846,7 +1846,7 @@ begin
fRunnableSw := ''; fRunnableSw := '';
for i := memo.Lines.Count-1 downto 0 do for i := memo.Lines.Count-1 downto 0 do
begin begin
cur := memo.Lines.Strings[i]; cur := memo.Lines[i];
// duplicated item // duplicated item
j := memo.Lines.IndexOf(cur); j := memo.Lines.IndexOf(cur);
if (j > -1) and (j < i) then if (j > -1) and (j < i) then
@ -2157,7 +2157,7 @@ begin
for i := 0 to lst.Count-1 do for i := 0 to lst.Count-1 do
begin begin
itm := TMenuItem.Create(self); itm := TMenuItem.Create(self);
itm.Caption := lst.Strings[i].extractFileName; itm.Caption := lst[i].extractFileName;
itm.Caption := stripFileExt(itm.Caption); itm.Caption := stripFileExt(itm.Caption);
itm.OnClick := @layoutMnuItemClick; itm.OnClick := @layoutMnuItemClick;
itm.ImageIndex := 32; itm.ImageIndex := 32;

View File

@ -800,7 +800,7 @@ begin
fDemangler.Execute; fDemangler.Execute;
for i := 0 to fToDemangle.Count-1 do for i := 0 to fToDemangle.Count-1 do
begin begin
str := fToDemangle.Strings[i] + LineEnding; str := fToDemangle[i] + LineEnding;
fDemangler.Input.Write(str[1], str.length); fDemangler.Input.Write(str[1], str.length);
end; end;
fDemangler.CloseInput; fDemangler.CloseInput;
@ -817,7 +817,7 @@ begin
begin begin
itm := TTreeNode(fToDemangleObjs.Items[i]); itm := TTreeNode(fToDemangleObjs.Items[i]);
if itm.isNil then continue; if itm.isNil then continue;
itm.Text := fToDemangle.Strings[i]; itm.Text := fToDemangle[i];
end; end;
freeDemangler; freeDemangler;
end; end;

View File

@ -404,8 +404,8 @@ begin
// prepares the exclusions // prepares the exclusions
for i := 0 to currentConfiguration.pathsOptions.exclusions.Count-1 do for i := 0 to currentConfiguration.pathsOptions.exclusions.Count-1 do
begin begin
str := symbolExpander.get(currentConfiguration.pathsOptions.exclusions.Strings[i]); str := symbolExpander.get(currentConfiguration.pathsOptions.exclusions[i]);
rel := expandFilenameEx(fBasePath, currentConfiguration.pathsOptions.exclusions.Strings[i]); rel := expandFilenameEx(fBasePath, currentConfiguration.pathsOptions.exclusions[i]);
if str.fileExists then if str.fileExists then
ex_files.Add(str) ex_files.Add(str)
else if str.dirExists then else if str.dirExists then
@ -425,7 +425,7 @@ begin
end; end;
// libraries: an asterisk in list selects all the entries // libraries: an asterisk in list selects all the entries
libAliasesPtr := fLibAliases; libAliasesPtr := fLibAliases;
if (fLibAliases.Count > 0) and (fLibAliases.Strings[0] = '*') then if (fLibAliases.Count > 0) and (fLibAliases[0] = '*') then
libAliasesPtr := nil; libAliasesPtr := nil;
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
@ -496,7 +496,7 @@ var
'Do you wish to select the new root folder ?') <> mrOk then exit; 'Do you wish to select the new root folder ?') <> mrOk then exit;
// TODO-cimprovement: use commonFolder() when it'll be compat. with the rel. paths. // TODO-cimprovement: use commonFolder() when it'll be compat. with the rel. paths.
// hint for the common dir // hint for the common dir
dirHint := fSrcs.Strings[i]; dirHint := fSrcs[i];
while (dirHint[1] = '.') or (dirHint[1] = DirectorySeparator) do while (dirHint[1] = '.') or (dirHint[1] = DirectorySeparator) do
dirHint := dirHint[2..dirHint.length]; dirHint := dirHint[2..dirHint.length];
ini := fFilename.extractFilePath; ini := fFilename.extractFilePath;
@ -504,11 +504,11 @@ var
exit; exit;
for i := 0 to fSrcs.Count-1 do for i := 0 to fSrcs.Count-1 do
begin begin
src := fSrcs.Strings[i]; src := fSrcs[i];
while (src[1] = '.') or (src[1] = DirectorySeparator) do while (src[1] = '.') or (src[1] = DirectorySeparator) do
src := src[2..src.length]; src := src[2..src.length];
if fileExists(expandFilenameEx(fBasePath, newdir + DirectorySeparator + src)) then if fileExists(expandFilenameEx(fBasePath, newdir + DirectorySeparator + src)) then
fSrcs.Strings[i] := ExtractRelativepath(fBasePath, newdir + DirectorySeparator + src); fSrcs[i] := ExtractRelativepath(fBasePath, newdir + DirectorySeparator + src);
hasPatched := true; hasPatched := true;
end; end;
end; end;
@ -631,7 +631,7 @@ begin
else if Sources.Count > 0 then else if Sources.Count > 0 then
begin begin
// ideally, main() should be searched for, when project binaryKind is executable // ideally, main() should be searched for, when project binaryKind is executable
fOutputFilename := Sources.Strings[0].extractFileName; fOutputFilename := Sources[0].extractFileName;
fOutputFilename := stripFileExt(fOutputFilename); fOutputFilename := stripFileExt(fOutputFilename);
if fileName.fileExists then if fileName.fileExists then
fOutputFilename := fileName.extractFilePath + fOutputFilename fOutputFilename := fileName.extractFilePath + fOutputFilename
@ -662,12 +662,12 @@ begin
// //
for i := 0 to processInfo.simpleCommands.Count-1 do for i := 0 to processInfo.simpleCommands.Count-1 do
begin begin
pname := symbolExpander.get(processInfo.simpleCommands.Strings[i]); pname := symbolExpander.get(processInfo.simpleCommands[i]);
proc := TProcess.Create(nil); proc := TProcess.Create(nil);
lst := TStringList.Create; lst := TStringList.Create;
try try
CommandToList(pname, lst); CommandToList(pname, lst);
proc.Executable := lst.Strings[0]; proc.Executable := lst[0];
proc.Options:= [poUsePipes, poStderrToOutPut]; proc.Options:= [poUsePipes, poStderrToOutPut];
lst.Delete(0); lst.Delete(0);
proc.Parameters.Assign(lst); proc.Parameters.Assign(lst);
@ -676,7 +676,7 @@ begin
lst.Clear; lst.Clear;
ce_common.processOutputToStrings(proc, lst); ce_common.processOutputToStrings(proc, lst);
for j := 0 to lst.Count -1 do for j := 0 to lst.Count -1 do
getMessageDisplay.message(lst.Strings[j], self as ICECommonProject, amcProj, amkAuto); getMessageDisplay.message(lst[j], self as ICECommonProject, amcProj, amkAuto);
finally finally
proc.Free; proc.Free;
lst.Free; lst.Free;
@ -697,7 +697,7 @@ begin
proc.Executable := exeFullName(pname); proc.Executable := exeFullName(pname);
j := proc.Parameters.Count-1; j := proc.Parameters.Count-1;
for i:= 0 to j do for i:= 0 to j do
proc.Parameters.AddText(symbolExpander.get(proc.Parameters.Strings[i])); proc.Parameters.AddText(symbolExpander.get(proc.Parameters[i]));
for i:= 0 to j do for i:= 0 to j do
proc.Parameters.Delete(0); proc.Parameters.Delete(0);
if proc.CurrentDirectory.isNotEmpty then if proc.CurrentDirectory.isNotEmpty then
@ -980,14 +980,14 @@ end;
function TCENativeProject.sourceRelative(index: integer): string; function TCENativeProject.sourceRelative(index: integer): string;
begin begin
exit(fSrcs.Strings[index]); exit(fSrcs[index]);
end; end;
function TCENativeProject.sourceAbsolute(index: integer): string; function TCENativeProject.sourceAbsolute(index: integer): string;
var var
fname: string; fname: string;
begin begin
fname := fSrcs.Strings[index]; fname := fSrcs[index];
if fname.fileExists then if fname.fileExists then
result := fname result := fname
else else
@ -1001,7 +1001,7 @@ end;
function TCENativeProject.importPath(index: integer): string; function TCENativeProject.importPath(index: integer): string;
begin begin
result := currentConfiguration.pathsOptions.importModulePaths.Strings[index]; result := currentConfiguration.pathsOptions.importModulePaths[index];
if fBasePath.dirExists then if fBasePath.dirExists then
result := expandFilenameEx(fBasePath, result); result := expandFilenameEx(fBasePath, result);
end; end;

View File

@ -138,12 +138,12 @@ begin
VK_UP: begin VK_UP: begin
fMruPos += 1; fMruPos += 1;
if fMruPos > fMru.Count-1 then fMruPos := 0; if fMruPos > fMru.Count-1 then fMruPos := 0;
txtInp.Text := fMru.Strings[fMruPos]; txtInp.Text := fMru[fMruPos];
end; end;
VK_DOWN: begin VK_DOWN: begin
fMruPos -= 1; fMruPos -= 1;
if fMruPos < 0 then fMruPos := fMru.Count-1; if fMruPos < 0 then fMruPos := fMru.Count-1;
txtInp.Text := fMru.Strings[fMruPos]; txtInp.Text := fMru[fMruPos];
end; end;
end; end;
end; end;

View File

@ -187,7 +187,7 @@ var
begin begin
i := fSynchroItem.IndexOf(Item); i := fSynchroItem.IndexOf(Item);
if i = -1 then exit(''); if i = -1 then exit('');
result := fSynchroValue.Strings[i]; result := fSynchroValue[i];
end; end;
procedure TCEProjectConfigurationWidget.syncroGetPropAsString(const ASection, Item, Value: string); procedure TCEProjectConfigurationWidget.syncroGetPropAsString(const ASection, Item, Value: string);

View File

@ -287,7 +287,7 @@ begin
listFiles(lst, dir, true); listFiles(lst, dir, true);
for i := 0 to lst.Count-1 do for i := 0 to lst.Count-1 do
begin begin
fname := lst.Strings[i]; fname := lst[i];
if isDlangCompilable(fname.extractFileExt) then if isDlangCompilable(fname.extractFileExt) then
fProject.addSource(fname); fProject.addSource(fname);
end; end;

View File

@ -353,7 +353,7 @@ begin
fmt := fileName + '(%d,%d): "%s"'; fmt := fileName + '(%d,%d): "%s"';
for i := 0 to high(res) do for i := 0 to high(res) do
begin begin
msg := format(fmt, [res[i].Y, res[i].X, Trim(lines.Strings[res[i].Y-1])]); msg := format(fmt, [res[i].Y, res[i].X, Trim(lines[res[i].Y-1])]);
msgs.message(msg, nil, amcMisc, amkInf); msgs.message(msg, nil, amcMisc, amkInf);
end; end;
finally finally

View File

@ -353,7 +353,7 @@ var
begin begin
for i := fMacros.Count-1 downto 0 do for i := fMacros.Count-1 downto 0 do
begin begin
text := fMacros.Strings[i]; text := fMacros[i];
if text.length >= 4 then if text.length >= 4 then
if text[1] = '$' then if text[1] = '$' then
if Pos('=', text) > 2 then if Pos('=', text) > 2 then

View File

@ -203,7 +203,7 @@ begin
end; end;
fSymbols[CPFS] := str.Text; fSymbols[CPFS] := str.Text;
if str.Count = 1 then if str.Count = 1 then
fSymbols[CPCD] := ExtractFileDir(Str.Strings[0]) fSymbols[CPCD] := ExtractFileDir(str[0])
else else
fSymbols[CPCD] := commonFolder(str); fSymbols[CPCD] := commonFolder(str);
finally finally
@ -264,9 +264,9 @@ begin
for i := 0 to elems.Count - 1 do for i := 0 to elems.Count - 1 do
begin begin
if elems.Objects[i].isNil then if elems.Objects[i].isNil then
Result += elems.Strings[i] Result += elems[i]
else else
case elems.Strings[i] of case elems[i] of
'<', '>': continue; '<', '>': continue;
'CAF', 'CoeditApplicationFile': Result += fSymbols[CAF]; 'CAF', 'CoeditApplicationFile': Result += fSymbols[CAF];
'CAP', 'CoeditApplicationPath': Result += fSymbols[CAP]; 'CAP', 'CoeditApplicationPath': Result += fSymbols[CAP];

View File

@ -1167,8 +1167,8 @@ begin
if fFileDate = newDate then exit; if fFileDate = newDate then exit;
if fFileDate <> 0.0 then if fFileDate <> 0.0 then
begin begin
// note: this could cause a bug in France during the switch from winter time to summer time. // note: this could cause a bug during the DST switch.
// e.g: save at 2h59, at 3h00, clock is reset to 2h00, set the focus on the doc: new version message. // e.g: save at 2h59, at 3h00 clock is reset to 2h00, set the focus on the doc: new version message.
if dlgOkCancel(format('"%s" has been modified by another program, load the new version ?', if dlgOkCancel(format('"%s" has been modified by another program, load the new version ?',
[shortenPath(fFilename, 25)])) = mrOk then [shortenPath(fFilename, 25)])) = mrOk then
begin begin
@ -1194,7 +1194,7 @@ var
begin begin
result := 0; result := 0;
if fMousePos.y-1 > Lines.Count-1 then exit; if fMousePos.y-1 > Lines.Count-1 then exit;
llen := Lines.Strings[fMousePos.y-1].length; llen := Lines[fMousePos.y-1].length;
if fMousePos.X > llen then exit; if fMousePos.X > llen then exit;
// //
// something note really clear: // something note really clear:
@ -1202,7 +1202,7 @@ begin
// TCESynMemo.getMouseFileBytePos works when using the line ending from the system. // TCESynMemo.getMouseFileBytePos works when using the line ending from the system.
len := getSysLineEndLen; len := getSysLineEndLen;
for i:= 0 to fMousePos.y-2 do for i:= 0 to fMousePos.y-2 do
result += Lines.Strings[i].length + len; result += Lines[i].length + len;
result += fMousePos.x; result += fMousePos.x;
end; end;
{$ENDREGION --------------------------------------------------------------------} {$ENDREGION --------------------------------------------------------------------}

View File

@ -586,9 +586,9 @@ begin
begin begin
col -= 1; col -= 1;
if col < item1.SubItems.Count then if col < item1.SubItems.Count then
txt1 := item1.SubItems.Strings[col]; txt1 := item1.SubItems[col];
if col < item2.SubItems.Count then if col < item2.SubItems.Count then
txt2 := item2.SubItems.Strings[col]; txt2 := item2.SubItems[col];
end; end;
Compare := AnsiCompareStr(txt1, txt2); Compare := AnsiCompareStr(txt1, txt2);
if lstItems.SortDirection = sdDescending then if lstItems.SortDirection = sdDescending then

View File

@ -83,7 +83,7 @@ var
i: Integer; i: Integer;
begin begin
for i := 0 to CustomTools.tools.Count-1 do for i := 0 to CustomTools.tools.Count-1 do
lstTools.Items.Strings[i] := CustomTools[i].toolAlias; lstTools.Items[i] := CustomTools[i].toolAlias;
end; end;
procedure TCEToolsEditorWidget.lstToolsSelectionChange(Sender: TObject; procedure TCEToolsEditorWidget.lstToolsSelectionChange(Sender: TObject;