Autor Beitrag
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Mi 15.08.07 13:24 
Hallo,

ich möchte per Highlighter.LoadFromFile einen Highlighter laden. Erstmal: ist der Dateityp .HGL dafür richtig?
Mein Code sieht so aus und in jedem Fall gibt es eine Exception, selbst wenn ich bei Exceptions stoppen drinne habe tritt der except Fall ein. Mein Code sieht so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  try
    if OpenDialog1.Execute then
      if SynEdit1.Highlighter.LoadFromFile(OpenDialog1.FileName) = True then
      ShowMessage('Operation erfolgreich');
  except
    ShowMessage('Fehler');
  end;

Kann mir jemand helfen? Was mache ich falsch?
chrisdrury
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

WinXP
D5 Prof
BeitragVerfasst: Fr 17.08.07 07:22 
Also wenn ich hgl-Dateien für den Highlighter lade, benutze ich die Komponente TSynUniSyn,
z. B. so:
ausblenden Delphi-Quelltext
1:
2:
3:
    SynUniSyn1.MainRules.Clear;
    SynUniSyn1.LoadFromFile(Dir + 'perl.hgl');
    SynEdit1.Highlighter:=SynUniSyn1;

Das funktioniert ohne Probleme, müsstest Du vielleicht für Deine Zwecke etwas anpassen... :wink:

Ach so, die Komponente gibt es hier: www.delphist.com/UniHighlighter.html
Jakob_Ullmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 22.09.07 08:16 
Aha, danke!