Comments on: Delphi Developer Certification Tips #3 http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/ Where Andreano Lanusse talk about technology, software development, programming techniques, databases, games and more through articles, tutorials and videos Tue, 23 Sep 2014 01:39:34 +0000 hourly 1 https://wordpress.org/?v=6.3.4 By: Certificação de Desenvolvedor Delphi | Marcos Rocha http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-48881 Tue, 23 Sep 2014 01:39:34 +0000 http://www.andreanolanusse.com/en/?p=662#comment-48881 […] http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/ […]

]]>
By: Central da Tecnologia | Certificação de Desenvolvedor Delphi http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11783 Fri, 18 Oct 2013 02:17:25 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11783 […] http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/ […]

]]>
By: Andreano Lanusse http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11221 Thu, 27 Sep 2012 19:54:13 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11221 In reply to Kris Golko.

@Kris, you should have the link on your e-mail.

You can also send an email to certification at embarcadero.com

]]>
By: Kris Golko http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11220 Thu, 27 Sep 2012 18:12:19 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11220 In reply to Andreano Lanusse.

Hi Andreano,

I’d like to download the certification logo. Perhaps you can tell, who should I ask.

Kind Regards

]]>
By: Andreano Lanusse http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11217 Tue, 25 Sep 2012 18:28:09 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11217 In reply to J.M. Stoorvogel.

JM,

Nice catch, you are correct and I updated the post.

Thanks

]]>
By: J.M. Stoorvogel http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11213 Tue, 18 Sep 2012 11:03:09 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11213 And if you want to free the TStringList, use a
try
try
FindFirst();
finally
FindClose();
end;
except
FreeAndNil(result)
Raise;
end;

construction.

Freeing btw is not the same as making nil. Because of the exception (which indicates that the postconditons cannot be met, by providing a valid TStringList as result), FreeAndNil is not really necessery.

]]>
By: J.M. Stoorvogel http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11212 Tue, 18 Sep 2012 10:53:18 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11212 In fact, now you’ve got a resource leak: FindClose is only called in case of an exception, but it should *ALWAYS* be called after FindFirst.

Correct code should be:
FindFirst
try
{exception possible}
finally
FindClose()
end;

]]>
By: J.M. Stoorvogel http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-11211 Tue, 18 Sep 2012 10:33:51 +0000 http://www.andreanolanusse.com/en/?p=662#comment-11211 Why not use a single try-finally statement? Inexperienced programmers will undoubtly make the mistake by writing something like try except catch E raise(E)end.

]]>
By: Andreano Lanusse http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-9474 Fri, 07 Oct 2011 22:27:58 +0000 http://www.andreanolanusse.com/en/?p=662#comment-9474 In reply to Jens K.

Thanks Jens, I fixed.

]]>
By: Jens K http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-9459 Tue, 04 Oct 2011 09:39:58 +0000 http://www.andreanolanusse.com/en/?p=662#comment-9459 … in the exception block is FindClose(SearchRec) missing

]]>
By: Dan H http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-9320 Thu, 11 Aug 2011 20:09:34 +0000 http://www.andreanolanusse.com/en/?p=662#comment-9320 Sanford, he only wants to free the Result if an error occurs, otherwise he is returning Result as a non-nil TStringList.

]]>
By: Sanford http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-9242 Fri, 05 Aug 2011 04:28:00 +0000 http://www.andreanolanusse.com/en/?p=662#comment-9242 So, in your “GetFileList” example, you are using try… except instead of try…finally because?

]]>
By: Developer Certification Tips #3 « Delphi, Delphi Prism, Visual Studio, C#, ASP.NET http://www.andreanolanusse.com/en/delphi-developer-certification-tips-3/#comment-9170 Sat, 30 Jul 2011 10:53:17 +0000 http://www.andreanolanusse.com/en/?p=662#comment-9170 […] Clique aqui. […]

]]>