Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   Code Vervollständigung D2006 (https://www.delphipraxis.net/148511-code-vervollstaendigung-d2006.html)

Sidorion 3. Mär 2010 07:53


Code Vervollständigung D2006
 
Kurze Frage: Wenn ich im Editor (D2006) ein try schreibe und dann <enter> drücke, wird automatisch ein finally-Block eingefügt. Kann man irgendwo in der IDE einstellen, dass standardmäßig ein except Block generiert wird?

himitsu 3. Mär 2010 08:19

Re: Code Vervollständigung D2006
 
pffff, wo diese Vorlage liegt, weiß ich garnicht,

aber in Menü Ansicht > Vorlagen und gibt es eine Vorlage für "try-except"

vorlangen werden mit Wort und dann Tabulator aufgerufen

"try" + Tabulatortaste
Delphi-Quellcode:
MyClass := TComponent.Create(Self);
try

finally
  MyClass.Free;
end;
"trye" + Tabulatortaste
Delphi-Quellcode:
try

except on E: Exception do
end;
"tryf" + Tabulatortaste
Delphi-Quellcode:
try

finally
end;
PS: Du kannst auch Eigene erstellen. (Dafür dürfte Daniel sogar ein Video haben)

Nersgatt 3. Mär 2010 08:56

Re: Code Vervollständigung D2006
 
Das dürfte dieses Video sein:
http://www.delphipraxis.net/bds2006videos#livetemplates

Sidorion 3. Mär 2010 09:27

Re: Code Vervollständigung D2006
 
Prima. Danke. Jetzt nervt nur noch dieses "on : do" aber das krieg ich auch noch weg.

himitsu 3. Mär 2010 09:42

Re: Code Vervollständigung D2006
 
Einfach das Template bearbeiten oder ein Neues erstellen:
XML-Code:
<?xml version="1.0" encoding="utf-8"?>

<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates" version="1.0.0">
   <template name="trye" surround="true" invoke="manual">
      <description>
         try except
      </description>
      <author>
         CodeGear
      </author>
      <code language="Delphi" context="methodbody" delimiter="|"><![CDATA[try
|selected||*||end|
except
end;
]]>
      </code>
   </template>
</codetemplate>


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz