Rename variable called section to _section to avoid parsing error for morphos OS

This commit is contained in:
Pierre Muller 2023-06-11 23:30:18 +02:00
parent ad1812f90a
commit 61e53fd42a
3 changed files with 13 additions and 13 deletions

View File

@ -574,7 +574,7 @@ var
Fini : TMemIniFile; // TMemInifile is more compatible with Delphi. Delphi's API based TIniFile fails on .hhp files.
secs,strs : TStringList;
i,j : Integer;
section : TSectionEnum;
_section : TSectionEnum;
nd : TChmContextNode;
begin
@ -615,10 +615,10 @@ begin
for i:=0 to secs.count-1 do
begin
section:=FindSectionName(Uppercase(Secs[i]));
if section<>secunknown then
_section:=FindSectionName(Uppercase(Secs[i]));
if _section<>secunknown then
fini.readsectionvalues(secs[i] ,strs);
case section of
case _section of
secOptions : readinioptions(strs);
secWindows : for j:=0 to strs.count-1 do
FWindows.add(TCHMWindow.Create(strs[j]));

View File

@ -40,7 +40,7 @@ type
{ TListObject }
TListObject = class
Section : Integer;
_Section : Integer;
count : integer;
donotpage: boolean;
nameonly : boolean;
@ -196,7 +196,7 @@ procedure TListObject.OnFileEntry(Name: String; Offset, UncompressedSize,
ASection: Integer);
begin
Inc(Count);
if (Section > -1) and (ASection <> Section) then Exit;
if (_Section > -1) and (ASection <> _Section) then Exit;
if (Count = 1) or ((Count mod 40 = 0) and not donotpage) then
begin
Write(StdErr, '<Section> ');
@ -274,7 +274,7 @@ end;
var donotpage:boolean=false;
name_only :boolean=false;
procedure ListChm(Const Name:string;Section:Integer);
procedure ListChm(Const Name:string;_Section:Integer);
var
ITS: TITSFReader;
Stream: TFileStream;
@ -289,7 +289,7 @@ begin
Stream := TFileStream.Create(name, fmOpenRead);
JunkObject := TListObject.Create;
JunkObject.Section:=Section;
JunkObject._Section:=_Section;
JunkObject.Count:=0;
JunkObject.DoNotPage:=DoNotPage;
JunkObject.NameOnly:=Name_Only;
@ -1002,7 +1002,7 @@ Var
Params,
OptionIndex : Longint;
cmd : TCmdEnum;
section : Integer = -1;
_section : Integer = -1;
// Start of program
begin
@ -1043,15 +1043,15 @@ begin
case cmd of
cmdlist : begin
case length(localparams) of
1 : ListChm(localparams[0],Section);
1 : ListChm(localparams[0],_Section);
2 : begin
if not TryStrToInt(localparams[1],section) then
if not TryStrToInt(localparams[1],_section) then
begin
writeln(stderr,' Invalid value for section ',localparams[2]);
usage;
halt(1);
end;
ListChm(localparams[0],Section);
ListChm(localparams[0],_Section);
end;
else
WrongNrParam(cmdnames[cmd],length(localparams));

View File

@ -50,7 +50,7 @@ type
end;
{ TITSFReader }
TFileEntryForEach = procedure(Name: String; Offset, UncompressedSize, Section: Integer) of object;
TFileEntryForEach = procedure(Name: String; Offset, UncompressedSize, _Section: Integer) of object;
TITSFReader = class(TObject)
protected