[Lazarus] 'with' is evil, isn't it?

classic Classic list List threaded Threaded
80 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[Lazarus] 'with' is evil, isn't it?

Max Vlasov
Hi,

Personally I stopped using 'with' keyword long time ago, but there are code fragments from the past and today I fixed a little bug showing again that it's a evil. TCanvas in lazarus has width and height properties while in Delphi it hasn't (at least some time ago). So the code below leads to different results in lazarus and Delphi, at least for design-time drawing.

procedure TControlDescendant.Paint;
begin
  with Canvas do
  begin
      Rectangle(0, 0, Width, Height);
  edn;
end;

So not only the 'with' context can silently change while the project is evolving, it can also change while it's being ported...

Max

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Michael Schnell
+1
-Michael

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Rich Saunders
In reply to this post by Max Vlasov
+1
Rich S.


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

silvioprog
+1.

--
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
LazWebSolutions - <code.google.com/p/lazwebsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Marcos Douglas
In reply to this post by Max Vlasov
2011/8/2 Max Vlasov <[hidden email]>:

> Hi,
>
> Personally I stopped using 'with' keyword long time ago, but there are code
> fragments from the past and today I fixed a little bug showing again that
> it's a evil. TCanvas in lazarus has width and height properties while in
> Delphi it hasn't (at least some time ago). So the code below leads to
> different results in lazarus and Delphi, at least for design-time drawing.
>
> procedure TControlDescendant.Paint;
> begin
>   with Canvas do
>   begin
>       Rectangle(0, 0, Width, Height);
>   edn;
> end;
>
> So not only the 'with' context can silently change while the project is
> evolving, it can also change while it's being ported...

IMHO, 'with' should have an implicit pointer like 'self' (could be
'this' or whatever).

Eg:

procedure TControlDescendant.Paint;
begin
  with Canvas do
  begin
      this.Rectangle(0, 0, this.Width, this.Height);
  edn;
end;

Marcos Douglas

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
ik
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

ik
On Tue, Aug 2, 2011 at 18:03, Marcos Douglas <[hidden email]> wrote:
2011/8/2 Max Vlasov <[hidden email]>:
> Hi,
>
> Personally I stopped using 'with' keyword long time ago, but there are code
> fragments from the past and today I fixed a little bug showing again that
> it's a evil. TCanvas in lazarus has width and height properties while in
> Delphi it hasn't (at least some time ago). So the code below leads to
> different results in lazarus and Delphi, at least for design-time drawing.
>
> procedure TControlDescendant.Paint;
> begin
>   with Canvas do
>   begin
>       Rectangle(0, 0, Width, Height);
>   edn;
> end;
>
> So not only the 'with' context can silently change while the project is
> evolving, it can also change while it's being ported...

IMHO, 'with' should have an implicit pointer like 'self' (could be
'this' or whatever).

Eg:

procedure TControlDescendant.Paint;
begin
 with Canvas do
 begin
     this.Rectangle(0, 0, this.Width, this.Height);
 edn;
end;

That's also bad. Because I can use for example "with" the following way:

with area, canvas do
  begin
    Rectangle(0,0, with, height);
  end;

If you'll have "this" or "self" or $_ (in perl :)) it still contain the same problem. I prefer explicit code then implicit code. It's more readable and less error prone.

I think that "with" like "goto" need to be enabled by special parameter and not allowed by default.
 

Marcos Douglas

Ido
 

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

cobines
In reply to this post by Marcos Douglas
Yes, it is treacherous. I try not to use it. Maybe if it only allowed
to refer to properties, functions of the "with" object, but it also
allows outer scope and you never know how the classes will change in
the future. Suddenly your code refers to entirely different data,
because someone decided to add a property to the "with" object.

Does it have any performance advantage (in the generated code)?

--
cobines

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Marcos Douglas
In reply to this post by ik
2011/8/2 ik <[hidden email]>:

> That's also bad. Because I can use for example "with" the following way:
>
> with area, canvas do
>   begin
>     Rectangle(0,0, with, height);
>   end;
>
> If you'll have "this" or "self" or $_ (in perl :)) it still contain the same
> problem. I prefer explicit code then implicit code. It's more readable and
> less error prone.
>
> I think that "with" like "goto" need to be enabled by special parameter and
> not allowed by default.

Yep... I forgot that sintaxe option because I never used.
Forget what I said.

Marcos Douglas

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Hans-Peter Diettrich
In reply to this post by Marcos Douglas
Marcos Douglas schrieb:

> IMHO, 'with' should have an implicit pointer like 'self' (could be
> 'this' or whatever).

This<g> will fail with nested With's, or a With with multiple expressions.

A nicer syntax would require only an "." for your "this.".

> Eg:
>
> procedure TControlDescendant.Paint;
> begin
>   with Canvas do
>   begin
>       this.Rectangle(0, 0, this.Width, this.Height);
         .Rectangle(0,0, .Width, .Height);
>   edn;
> end;

DoDi


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Jürgen Hestermann
In reply to this post by Max Vlasov
Max Vlasov schrieb:
 > Personally I stopped using 'with' keyword long time ago, but there
are code fragments from the past and today I fixed a little bug showing
again that it's a evil.
 > TCanvas in lazarus has width and height properties while in Delphi it
hasn't (at least some time ago). So the code below leads to different
results in lazarus and Delphi, at least for design-time drawing.
 > procedure TControlDescendant.Paint;
 > begin
 >   with Canvas do
 >   begin
 >       Rectangle(0, 0, Width, Height);
 >   edn;
 > end;
 > So not only the 'with' context can silently change while the project
is evolving, it can also change while it's being ported...


I don't know what "Width" and "Height" refer to in Delphi if Canvas has
no such properties. In general I would expect to get an "unknown
identifier" error message in this case. I think that the possibility of
correct syntax (but different behaviour) is not very high. But of
course, porting code is always an adventure.


In general I find the "with" statement very useful and have used and do
use it a lot. Though it must be used in well defined short code blocks
only. If you have very convoluted data structures with deeply nested
arrays and records and pointers to them then it is a benefit not to be
forced to write the same expression over and over again. And it also
saves the program from calculating array indices and other references in
these expressions multiple times so it speeds up the code too. I.e., if
you have an expression like this:

-----------------------------------------------------------------------
AusdehnungInMeter :=
(Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[length(Qarray[QuaderNr]^.Teilung[R].Einteilungen)+1]
-
                                     
Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[1]) *
                                     
EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;
-----------------------------------------------------------------------

it is much easier to read (and calculate) in a with statement:

-----------------------------------------------------------------------
with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
   AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
                                       Feldgrenzen[1]) *
                                       
EinheitAuswahl[Einheit.Koord[R]].Faktor;
-----------------------------------------------------------------------

It also saves you from typos within some of the expressions because you
only have to type them once. Identifiers have to be unique to make it
work but I never had a problem with a with statement so far.




--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Mark Morgan Lloyd
In reply to this post by Hans-Peter Diettrich
Hans-Peter Diettrich wrote:

> Marcos Douglas schrieb:
>
>> IMHO, 'with' should have an implicit pointer like 'self' (could be
>> 'this' or whatever).
>
> This<g> will fail with nested With's, or a With with multiple expressions.
>
> A nicer syntax would require only an "." for your "this.".
>
>> Eg:
>>
>> procedure TControlDescendant.Paint;
>> begin
>>   with Canvas do
>>   begin
>>       this.Rectangle(0, 0, this.Width, this.Height);
>         .Rectangle(0,0, .Width, .Height);
>>   edn;
>> end;

One I've floated elsewhere is to allow  with  to define an alias with
the same notation as a constant:

   with tsm= TSming(caller^) do begin
     while tsm.Count <= writePos do
       tsm.Append('');

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Martin Frb
In reply to this post by Jürgen Hestermann
On 02/08/2011 17:39, Jürgen Hestermann wrote:

>
> In general I find the "with" statement very useful and have used and
> do use it a lot. Though it must be used in well defined short code
> blocks only. If you have very convoluted data structures with deeply
> nested arrays and records and pointers to them then it is a benefit
> not to be forced to write the same expression over and over again. And
> it also saves the program from calculating array indices and other
> references in these expressions multiple times so it speeds up the
> code too. I.e., if you have an expression like this:
>
> -----------------------------------------------------------------------
> AusdehnungInMeter :=
> (Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[length(Qarray[QuaderNr]^.Teilung[R].Einteilungen)+1]
> -
>                                    
> Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[1]) *
>                                    
> EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;
> -----------------------------------------------------------------------
>
> it is much easier to read (and calculate) in a with statement:
>
> -----------------------------------------------------------------------
> with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
>   AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
>                                       Feldgrenzen[1]) *
>                                      
> EinheitAuswahl[Einheit.Koord[R]].Faktor;
> -----------------------------------------------------------------------
>
Why put Uebergabe^ in the with? It appears only once?


Assuming objects, better add helper methods

function TFooTeilung.GetLastFirstDiff;
begin
   Result := Feldgrenzen[ length(Einteilungen)+1 ] - Feldgrenzen[1];
end

AusdehnungInMeter :=
    Qarray[QuaderNr]^.Teilung[R].  GetLastFirstDiff
    *  EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;


You can also introduce
    FeldgrenzenBackwards[x]
where 0 returns the last, 1 the one before last ....

If it may be other than last and first, give 2 params to    
GetLastFirstDiff(  ElemFromEndIdx,   ElemFromStartIdx  )
eg GetLastFirstDiff(0,0) for Last-First

Would further shorten this (assuming that Einteilungen and Feldgrenzen
are of the same length ?)

IMHO, that makes it much more readable.



you can even add an appropriately named method to the object returned by
"Qarray[QuaderNr]^" , if it is an object (or record with method)

AusdehnungInMeter :=
    Qarray[QuaderNr]^.  GetLastFirstDiffForTeilung(R)
    *  EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;

OR
AusdehnungInMeter :=
    Qarray[QuaderNr]^.  GetLastFirstDiffForTeilungFooBar(R, Uebergabe)


and do the multiplikation inside that (you got Uebergabe and R


Martin

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Jürgen Hestermann
 >> -----------------------------------------------------------------------
 >> with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
 >>   AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
 >>                                       Feldgrenzen[1]) *
 >>                                      
EinheitAuswahl[Einheit.Koord[R]].Faktor;
 >> -----------------------------------------------------------------------
 >>
 > Why put Uebergabe^ in the with? It appears only once?

Yes, that's true. I just picked an arbitrary example from my code to get
the idea. I have lots of with statements with similar "with-variables".
Sometimes  they are used only once and in other cases they are used more
often.


 > Assuming objects, better add helper methods
 > function TFooTeilung.GetLastFirstDiff;
 > begin
 >   Result := Feldgrenzen[ length(Einteilungen)+1 ] - Feldgrenzen[1];
 > end

I don't want to add runtime penalties by calling functions (with stack
handling overhead).


 > AusdehnungInMeter :=
 >    Qarray[QuaderNr]^.Teilung[R].  GetLastFirstDiff
 >    *  EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;
 > You can also introduce
 >    FeldgrenzenBackwards[x]
 > where 0 returns the last, 1 the one before last ....

Same reason: It's slower and does not add any benefit.

Of course, there is an inifite way of coding things and the with
statement is one of them.


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Marcos Douglas
In reply to this post by Mark Morgan Lloyd
On Tue, Aug 2, 2011 at 2:21 PM, Hans-Peter Diettrich
<[hidden email]> wrote:

> Marcos Douglas schrieb:
>
>> IMHO, 'with' should have an implicit pointer like 'self' (could be
>> 'this' or whatever).
>
> This<g> will fail with nested With's, or a With with multiple expressions.
>
> A nicer syntax would require only an "." for your "this.".
>
>> Eg:
>>
>> procedure TControlDescendant.Paint;
>> begin
>>  with Canvas do
>>  begin
>>      this.Rectangle(0, 0, this.Width, this.Height);
>
>        .Rectangle(0,0, .Width, .Height);
>>
>>  end;
     end;

OK, could be... but not prevents confusion of properties.


On Tue, Aug 2, 2011 at 1:56 PM, Mark Morgan Lloyd
<[hidden email]> wrote:
> One I've floated elsewhere is to allow  with  to define an alias with the
> same notation as a constant:
>
>  with tsm= TSming(caller^) do begin
>    while tsm.Count <= writePos do
>      tsm.Append('');

I like it, but FPC's team doesn't will, I think...
Alias already was proposed even to Units but did not approved.

Marcos Douglas

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

cobines
In reply to this post by Jürgen Hestermann
2011/8/2 Jürgen Hestermann <[hidden email]>:
> And it also saves the program from
> calculating array indices and other references in these expressions multiple
> times so it speeds up the code too.

I didn't know that, but indeed it does.

> I.e., if you have an expression like
> this:
>
> -----------------------------------------------------------------------
> AusdehnungInMeter :=
> (Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[length(Qarray[QuaderNr]^.Teilung[R].Einteilungen)+1]
> -
>
>  Qarray[QuaderNr]^.Teilung[R].Feldgrenzen[1]) *
>
>  EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;
> -----------------------------------------------------------------------
>
> it is much easier to read (and calculate) in a with statement:
>
> -----------------------------------------------------------------------
> with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
>  AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
>                                      Feldgrenzen[1]) *
>
>  EinheitAuswahl[Einheit.Koord[R]].Faktor;
> -----------------------------------------------------------------------
>

In case Qarray[QuaderNr]^.Teilung[R] is an object I usually do:

tmp := Qarray[QuaderNr]^.Teilung[R];

AusdehnungInMeter :=  (tmp.Feldgrenzen[length(tmp.Einteilungen)+1] -
tmp.Feldgrenzen[1]) *
EinheitAuswahl[Uebergabe^.Einheit.Koord[R]].Faktor;

It results in a similar code than using "with", because from what I
see "with" creates an implicit local var or uses a register to store
the address.

For records one could use tmp as a pointer to the record, and then
refer to tmp^.

--
cobines

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Hans-Peter Diettrich
In reply to this post by Marcos Douglas
Marcos Douglas schrieb:

> On Tue, Aug 2, 2011 at 2:21 PM, Hans-Peter Diettrich
> <[hidden email]> wrote:
>> Marcos Douglas schrieb:
>>
>>> IMHO, 'with' should have an implicit pointer like 'self' (could be
>>> 'this' or whatever).
>> This<g> will fail with nested With's, or a With with multiple expressions.
>>
>> A nicer syntax would require only an "." for your "this.".
>>
>>> Eg:
>>>
>>> procedure TControlDescendant.Paint;
>>> begin
>>>  with Canvas do
>>>  begin
>>>      this.Rectangle(0, 0, this.Width, this.Height);
>>        .Rectangle(0,0, .Width, .Height);
>>>  end;
>      end;
>
> OK, could be... but not prevents confusion of properties.

No chance. The syntax doesn't allow for
   <identifier> <identifier> "." ...

DoDi


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Hans-Peter Diettrich
In reply to this post by Jürgen Hestermann
Jürgen Hestermann schrieb:

> with Uebergabe^, Qarray[QuaderNr]^.Teilung[R] do
>   AusdehnungInMeter := (Feldgrenzen[length(Einteilungen)+1] -
>                                       Feldgrenzen[1]) *
>                                      
> EinheitAuswahl[Einheit.Koord[R]].Faktor;

This is very close to the explicit pointer version:

   U := Uebergabe;
   Q := Qarray[QuaderNr]^.Teilung[R];
   AusdehnungInMeter := (Q.Feldgrenzen[length(Einteilungen)+1] -
                         Q.Feldgrenzen[1]) *
EinheitAuswahl[U^.Einheit.Koord[R]].Faktor;

Only the declarations for U and Q have to be added, and the debugger
will have no problem with guessing the correct prefix.

DoDi


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Luiz Americo Pereira Camara
In reply to this post by Max Vlasov
On 2/8/2011 11:38, Max Vlasov wrote:

> Hi,
>
> Personally I stopped using 'with' keyword long time ago, but there are
> code fragments from the past and today I fixed a little bug showing
> again that it's a evil. TCanvas in lazarus has width and height
> properties while in Delphi it hasn't (at least some time ago). So the
> code below leads to different results in lazarus and Delphi, at least
> for design-time drawing.
>
> procedure TControlDescendant.Paint;
> begin
>   with Canvas do
>   begin
>       Rectangle(0, 0, Width, Height);
>   edn;
> end;
>
> So not only the 'with' context can silently change while the project
> is evolving, it can also change while it's being ported...


I also ran into this problem while porting Delphi code

http://lazarusroad.blogspot.com/2007/02/traps-of-delphi-to-lazarus-conversion.html

Luiz

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Max Vlasov
In reply to this post by Marcos Douglas
On Tue, Aug 2, 2011 at 7:03 PM, Marcos Douglas <[hidden email]> wrote:
2011/8/2 Max Vlasov <[hidden email]>:
> Hi,
>
> Personally I stopped using 'with' keyword long time ago, but there are code
> fragments from the past and today I fixed a little bug showing again that
> it's a evil.
> .....
>
> So not only the 'with' context can silently change while the project is
> evolving, it can also change while it's being ported...

 
IMHO, 'with' should have an implicit pointer like 'self' (could be
'this' or whatever).

Eg:

procedure TControlDescendant.Paint;
begin
 with Canvas do
 begin
     this.Rectangle(0, 0, this.Width, this.Height);
 edn;
end;


Reading all the discussion and suggestions, some thoughts came
1. Introducing a check in the compiler setting (or a conditional define) that could force the developer to use self inside 'with' constructions. So with this setting on, any access to fields, properties or methods will require explicit self or 'identifier not found' will be fired.  This solution still won't save from many problem situation (including the one I gave an example), but at least it is compatible with existing Delphi syntax and make some constructions more readable

2. Some switch (maybe on by default) that prevents from compiling if there are several duplicate names in the same 'with' context (including global, local, fields). The developer in this case has at least options to rename local variables, include self for fields to resolve the problem or not using with if there are no other options.
In contrary to 1. this would solve the example I gave since there are two widths and heights in the context of 'with' construction.

What do you think?

Max

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] 'with' is evil, isn't it?

Jürgen Hestermann
In reply to this post by cobines
cobines schrieb:
> In case Qarray[QuaderNr]^.Teilung[R] is an object I usually do:
> tmp := Qarray[QuaderNr]^.Teilung[R];
>  
Yes, of course. But it's just so much easier to use "with" which does
the same in the background and save you from adding local variables
yourself.



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
1234