<a href="mailto:shiruba@galapagossoftware.com" target="_blank">shiruba</a>'s example is better than mine, and was exactly the reason I posted this suggestion.<br><br>I don't think a class helper is worth for this stuff, if I need to write a helper I would rather do this:<br>
<br><span style="font-family:courier new,monospace">longobj := BigLongThingIDontWantToWriteOu</span><span style="font-family:courier new,monospace">tEverySingleTime;<br>With longobj do begin<br></span><div><span style="font-family:courier new,monospace"> Height := 100;<br>
Width := 200;<br> ...<br> SomeOtherObject.Submit(longobj</span><span style="font-family:courier new,monospace">);<br>
end;</span></div><span style="font-family:courier new,monospace"><br>That's not elegant, but it is really not worth for a helper in this case, IMHO. "with" itself is a convenience syntax anyway, why adding an "as" to make it more convenient a bad idea? I don't know what's make it complex if there are 2 or more subject in the with?<br>
<br></span><br>2013/3/17 Daniel Gaspary <span dir="ltr"><<a href="mailto:dgaspary@gmail.com" target="_blank">dgaspary@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sat, Mar 16, 2013 at 3:02 PM, 印場 乃亜 <<a href="mailto:shiruba@galapagossoftware.com" target="_blank">shiruba@galapagossoftware.com</a>> wrote:<br>
> With BigLongThingIDontWantToWriteOutEverySingleTime do<br>
> begin<br>
> Height := 100;<br>
> Width := 200;<br>
> ...<br>
> SomeOtherObject.Submit(BigLongThingIDontWantToWriteOutEverySingleTime);<br>
> end;<br>
><br>
> Notice how I have to write the long thing out again at the bottom. There<br>
> must be a way around that (Something like "Self", but that refers to<br>
> whatever you are using in With).<br>
<br>
</div>You can use a Class Helper:<br>
<br>
<a href="http://pastebin.com/pFL49byh" target="_blank">http://pastebin.com/pFL49byh</a><br>
<br>
But you gonna need to use a type cast. And with a "SomethingElse" at<br>
the with, as showed by Xiangrong, things can become messy.<br></blockquote></div>