Re: createObject????
From: AustinMN (tacooperX_at_Xatt.net)
Date: 08/31/04
- Next message: Hapticz: "Re: Question about RS232 compatibility"
- Previous message: VKY: "Installer recommendation"
- In reply to: MikeD: "Re: createObject????"
- Next in thread: Mike D Sutton: "Re: createObject????"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 02:21:00 GMT
MikeD wrote:
<snip>
> 3 instances DO get created. However, because each instance gets assigned
to
> the same object variable, before the assignment actually occurs, the
> previous instance gets set to Nothing automatically. Here's what happens,
> step by step:
>
> 1. Set fso = createObject("Scripting.FileSystemObject")
> 1.a An instance of FSO is created and assigned to the object variable fso
>
> 2. Set fso = createObject("Scripting.FileSystemObject")
> 2.a. A second instance of FSO is created.
> 2.b The first instance of FSO is set to Nothing because the second
instance
> is about to get assigned to the same object variable
> 2.c The second instance of FSO is assigned to the object variable fso
>
> 3. Set fso = createObject("Scripting.FileSystemObject")
> 3.a. A third instance of FSO is created.
> 3.b The second instance of FSO is set to Nothing because the third
instance
> is about to get assigned to the same object variable
> 3.c The third instance of FSO is assigned to the object variable fso
>
> I don't know how much clearer I can make this. <g>
>
> (Unless I've been wrong for years about all of this; but I don't think I
> am).
Nope, that was exactly what I was going to post. CreateObject does exactly
that...it creates an object. It doesn't check to see if it's being assinged
to a variable that already contains an instance of the type of object it's
creating. It simply creates one, no matter how many it already created.
Austin
- Next message: Hapticz: "Re: Question about RS232 compatibility"
- Previous message: VKY: "Installer recommendation"
- In reply to: MikeD: "Re: createObject????"
- Next in thread: Mike D Sutton: "Re: createObject????"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|