Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dim Var as new Type 1

Status
Not open for further replies.

BB101

Programmer
Joined
May 23, 2001
Messages
337
Location
GB
Is it true there is a memory leak (or something similar) when you use the code:
Dim var as new type
rather than
Dim var as type
set var = new type

Thanks
--BB
 
you may find some answers in these threads

thread222-297780
thread222-471548

good luck

apologies if this gets posted more than once(this about my 20th attempt to post [page cannot be found error]) If somethings hard to do, its not worth doing - Homer Simpson
 
Nice one, thats cleared that up! :) --BB
 
Not a memory leak problem that I know of.
In the 2 examples given, the first is using Early binding and as such VB's IntelliSense functions will help you in writing your code. This is the preferable method to use.
The second is late binding, and the object<var> is nothing more than a space holder in memory for something(VB has no idea what it is until you tell it). As such, it is harder to program to and certainly harder for someone else to read/debug/refine your code.

HTH
Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top