On Sat, 7 Nov 2015 11:39:44 +0100
Jürgen Hestermann <juergen.hesterm...@gmx.de> wrote:

>[...]
> CodeTools do not help you *read* the code.

It can help you writing the code more readable and helps to read (i.e.
understand) the code by hints and find declaration.

 
>[...]
> -----------------------------
> with PathArray[High(PathArray)]^ do
>     fillchar(StatisticOfFiles,sizeof(StatisticOfFiles),0);
> -----------------------------
> 
> instead of this:
> 
> -----------------------------
> fillchar(PathArray[High(PathArray)]^.StatisticOfFiles,sizeof(PathArray[High(PathArray)]^.StatisticOfFiles),0);
> -----------------------------

An one liner with only one used variable is a pretty safe 'with' and
is mostly a matter of taste.

But a complicated expression like PathArray[High(PathArray)]^ can be
made more readable (easier to understand) like this:

LastPath:=PathArray[High(PathArray)];
fillchar(LastPath^.StatisticOfFiles,sizeof(LastPath^.StatisticOfFiles),0);

Use Ctrl+Shift+C on LastPath to create the pointer variable.

Mattias

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to