<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Ok, I don't want to argument about formating.<br>But did you see that the call to FindManagedControl(found); is useless ?<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Juha Manninen <juha.manninen@phnet.fi><br><b><span style="font-weight: bold;">An:</span></b> Lazarus mailing list <lazarus@lists.lazarus.freepascal.org><br><b><span style="font-weight: bold;">Gesendet:</span></b> Mittwoch, den 5. Mai 2010, 13:34:09 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Lazarus] Challenge of converting a Delphi project<br></font><br>Samuel Herzog
wrote:<br>> They way I format the my source-code and and ess-model is a good example why <br>such things are important<br>> <br>> Original:<br>> ******<br>> procedure TessConnectPanel.DblClick;<br>> var<br>> found: TControl;<br>> begin<br>> inherited;<br>> found := FindLCLWindow(Mouse.CursorPos);<br>> if Assigned(found) then<br>> begin<br>> FindManagedControl(found);<br>> if found <> Self then<br>> TCrackControl(found).DblClick;<br>> end;<br>> end;<br>> <br>> The same with my formating-style:<br>> **************************<br>> procedure TessConnectPanel.DblClick;<br>> var<br>> found: TControl;<br>> begin<br>> inherited;<br>> found := FindLCLWindow(Mouse.CursorPos);<br>> if not Assigned(found) then exit;<br>>
FindManagedControl(found);<br>> if found = Self then exit;<br>> TCrackControl(found).DblClick;<br>> end;<br>> <br>> Much better to read, and you see at once, that "FindManagedControl" looks <br>strange!<br>> <br>> There is only one rule that applies for all programmer's! We read source-<br>code from top-down. <br>> That's why I try to avoid "else"-statements.<br><br>Thanks, I took out the useless FindManagedControl call. It was already in the <br>original EssModel code.<br><br>I must say I like the original indented formatting more.<br>Indentation carries information by itself. Your formatting loses that <br>information. ... and there was no "else"-statements.<br><br>Anyway, it is a minor thing.<br><br><br>Regards,<br>Juha<br><br>--<br>_______________________________________________<br>Lazarus mailing list<br><a ymailto="mailto:Lazarus@lists.lazarus.freepascal.org"
href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br><a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br></div></div>
</div><br></body></html>