<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I implemented "class code creation" in r51851. I was already tired
of creating/copying object variables by hand. The idea is the same
as with code creation (ctrl+shift+c), but the variable is created in
one of the class section:<br>
<br>
<tt>unit Unit1;</tt><tt><br>
</tt><tt><br>
</tt><tt>{$mode objfpc}{$H+}</tt><tt><br>
</tt><tt><br>
</tt><tt>interface</tt><tt><br>
</tt><tt><br>
</tt><tt>type</tt><tt><br>
</tt><tt> TClass = class</tt><tt><br>
</tt><tt> private</tt><tt><br>
</tt><tt> procedure Test(y: integer);</tt><tt><br>
</tt><tt> end;</tt><tt><br>
</tt><tt><br>
</tt><tt>implementation</tt><tt><br>
</tt><tt><br>
</tt><tt>{ TClass }</tt><tt><br>
</tt><tt><br>
</tt><tt>procedure TClass.Test(y: integer);</tt><tt><br>
</tt><tt>begin</tt><tt><br>
</tt><tt> x| := y;</tt><tt><br>
</tt><tt>end;</tt><tt><br>
</tt><tt><br>
</tt><tt>end.</tt><tt><br>
</tt><br>
Hit Ctrl+Shift+X on the undeclared variable x and you get a dialog:<br>
<br>
<img src="cid:part1.07060103.06040102@kluug.net" alt=""><br>
<br>
Select the section and voila, x is declared as private variable:<br>
<br>
<tt>unit Unit1;</tt><tt><br>
</tt><tt><br>
</tt><tt>{$mode objfpc}{$H+}</tt><tt><br>
</tt><tt><br>
</tt><tt>interface</tt><tt><br>
</tt><tt><br>
</tt><tt>type</tt><tt><br>
</tt><tt> TClass = class</tt><tt><br>
</tt><tt> private</tt><tt><br>
</tt><tt> x: Integer;</tt><tt><br>
</tt><tt> procedure Test(y: integer);</tt><tt><br>
</tt><tt> end;</tt><tt><br>
</tt><tt><br>
</tt><tt>implementation</tt><tt><br>
</tt><tt><br>
</tt><tt>{ TClass }</tt><tt><br>
</tt><tt><br>
</tt><tt>procedure TClass.Test(y: integer);</tt><tt><br>
</tt><tt>begin</tt><tt><br>
</tt><tt> x := y;</tt><tt><br>
</tt><tt>end;</tt><tt><br>
</tt><tt><br>
</tt><tt>end.</tt><tt><br>
</tt><br>
It is the first version, it probably will need some tuning, so
please give feedback.<br>
<br>
Ondrej<br>
</body>
</html>