From: Peter Olcott on
Can a Component written in VBScript return an array of different Object
types? In other words the elements of the array are not the same type.

--
100% Accurate Display Screen OCR
http://www.OCR4Screen.com
From: ekkehard.horner on
Peter Olcott schrieb:
> Can a Component written in VBScript return an array of different Object
> types? In other words the elements of the array are not the same type.
>
Yes; all data in VBScript is stored in Variants, so you may even mix
plain and oop 'objects'. The retured thingy is just another Variant
of subtype array.

So just create/fill your array and assign it to the function name.

Whether the client/consumer can work with such a data structure is
another question.

But: returning an array of heteregenous objects will propably break
encapsulation.

From: Peter Olcott on
On 8/6/2010 11:27 AM, ekkehard.horner wrote:
> Peter Olcott schrieb:
>> Can a Component written in VBScript return an array of different Object
>> types? In other words the elements of the array are not the same type.
>>
> Yes; all data in VBScript is stored in Variants, so you may even mix
> plain and oop 'objects'. The retured thingy is just another Variant
> of subtype array.
>
> So just create/fill your array and assign it to the function name.
>
> Whether the client/consumer can work with such a data structure is
> another question.
>
Exactly what do you mean by this? I was thinking that anything created
by a scripting language would be able to be consumed by every language.

> But: returning an array of heteregenous objects will propably break
> encapsulation.
>
I am creating a dynamic object hierarchy. The array of heterogeneous
objects is the means by which I am providing containment of objects
within other objects.

--
100% Accurate Display Screen OCR
http://www.OCR4Screen.com
From: Mayayana on
I don't know if you can actually create an array
of objects. It sounds like what you want is
a Dictionary. But if you want an object hierarchy
it might be better to use classes.

| Can a Component written in VBScript return an array of different Object
| types? In other words the elements of the array are not the same type.
|


From: Peter Olcott on
On 8/6/2010 7:07 PM, Mayayana wrote:
> I don't know if you can actually create an array
> of objects. It sounds like what you want is
> a Dictionary. But if you want an object hierarchy
> it might be better to use classes.

I want a dynamic Object hierarchy that is created at run-time. This
dynamic Object hierarchy must work in every language that supports ActiveX.

>
> | Can a Component written in VBScript return an array of different Object
> | types? In other words the elements of the array are not the same type.
> |
>
>


--
100% Accurate Display Screen OCR
http://www.OCR4Screen.com