Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delphi 2006 compile error in SynHighlighterPas, line 1355 #171

Open
dummzeuch opened this issue Apr 2, 2021 · 1 comment
Open

Delphi 2006 compile error in SynHighlighterPas, line 1355 #171

dummzeuch opened this issue Apr 2, 2021 · 1 comment

Comments

@dummzeuch
Copy link

dummzeuch commented Apr 2, 2021

KEY_WOW64_32KEY is not declared in Delphi 2006, so the condition in procedure TSynPasSyn.EnumUserSettings must be changed to {$IFNDEF SYN_DELPHI_2007_UP}:

This is the working code:

procedure TSynPasSyn.EnumUserSettings(DelphiVersions: TStrings);

{$IFNDEF SYN_DELPHI_2007_UP}
const
KEY_WOW64_64KEY = $0100;
KEY_WOW64_32KEY = $0200;
{$ENDIF}

procedure LoadKeyVersions(const Key, Prefix: string);
var
Versions: TStringList;
i: Integer;
begin
with TBetterRegistry.Create(KEY_READ or KEY_WOW64_32KEY) do
begin
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly(Key) then
begin
try
Versions := TStringList.Create;
try
GetKeyNames(Versions);
for i := 0 to Versions.Count - 1 do
DelphiVersions.Add(Prefix + Versions[i]);
finally
FreeAndNil(Versions);
end;
finally
CloseKey;
end;
end;
finally
Free;
end;
end;
end;

begin
LoadKeyVersions('\SOFTWARE\Borland\Delphi', '');
LoadKeyVersions('\SOFTWARE\Borland\BDS', BDSVersionPrefix);
LoadKeyVersions('\SOFTWARE\CodeGear\BDS', BDSVersionPrefix);
LoadKeyVersions('\SOFTWARE\Embarcadero\BDS', BDSVersionPrefix);
end;

@dummzeuch
Copy link
Author

dummzeuch commented Apr 2, 2021

(How does one tag multiline code? seems only to work for single lines )

@dummzeuch dummzeuch changed the title Delphi 2006 compile error in SynHighlitherPas, line 1355 Delphi 2006 compile error in SynHighligtherPas, line 1355 Apr 2, 2021
@dummzeuch dummzeuch changed the title Delphi 2006 compile error in SynHighligtherPas, line 1355 Delphi 2006 compile error in SynHighlighterPas, line 1355 Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant