Use of With statements

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

Hi,

I was wondering if there was any impact on the efficiency of code (either
positive or negative) when using With .... End statements? I also heard that
the use of the keyword caused memory leaks in VB6, is this true??

Thanks,

Jon
 
Hi Jon,

'With' is a shorthand for creating and using a temporary reference
variable The more complex the expression in the With, the better the outcome
in both readability and efficiency.

Regards,
Fergus
 
* "Jon said:
I was wondering if there was any impact on the efficiency of code (either
positive or negative) when using With .... End statements? I also heard that
the use of the keyword caused memory leaks in VB6, is this true??

<http://www.google.de/[email protected]>

In VB Classic, the 'With...End With' block didn't cause memory leaks
when used properly.
 
Hi Herfried,

How do you 'mis-use' a With - jumping out of it perhaps?

Regards,
Fergus
 
* "Fergus Cooney said:
How do you 'mis-use' a With - jumping out of it perhaps?

ACK. There is a remark in the documentation that you whould not do that.
 
Hi Fergus,
I find it always the problem, if I do have to rearange code, when there is a
with in it, I don't like it, I think it is a matter of taste.
Cor
 
Howdy Cor,

I agree. When they first came out I thought they were a great idea, then
the lack of a variable, the extra indentation, and extra editing that was
often necessary when doing code rearrangent, like you said, made me discard
them for the most part.

Regards,
Fergus
 
Back
Top