Same Thing

Same Thing

Post by Hank » Wed, 24 Sep 2003 14:22:52


I'm getting the exact same thing! How do we combat this? E-
mail me as soon as someone finds out...OK?
 
 
 

1. The Thing is Thinging or The Thing Things

2. Sub(Thing as Object) {thing = new Thing.GetType} ?

Hello,
Sorry for polluting the VB newsgroup with curly brackets, but I couldn't
think how to get that question onto one line otherwise.
Anyway, I'm trying to write a Sub, or Function which takes an object as an
input and then creates a new object of the same type using that class'
constructor.
VB isn't currently liking any of my attempts, but the general idea is to
have:

Private Function NewInterfaceObjectArray(ByVal InterfaceObject As
Object(), ByVal defaultValue As Integer) As InterfaceObjectClass()
InterfaceObject = New InterfaceObject.GetType
Return InterfaceObject
End Function


That's a bit messy, even for pseudocode, but I think you'll get the idea..

I guess this is a bit of a weird question, but it's mostly because the
idea intrigued me while I was writing a long constructor for an object
made of object arrays, which were all interfaces onto a single object
type. I'm *sure* there was a good reason for coding that at the time...

Anyway, I can get round the problem, but I'm interested in whether the
language supports the idea of the function I'm asking about, and the
question seems to be too obscure for google (or my use of google) to cope
with.

KF


--
Using Opera's revolutionary e-mail client: http://www.yqcomputer.com/

3. CF 2.0 (March alpha): Things I like...and things still missing

4. Is it a configuration thing or a version thing?

5. Thing 1 and Thing 2 (and what to do?)

6. A "Word" thing or an "Outlook" thing"

7. Selecting Many Things Rather Than Selecting One Thing FromMany

8. vs2005 publish website doing bad things, bad things

9. Would like to trade 64 things for vic 20 things

10. SP3 - FAILURE TO INSTALL But that's a GOOD thing, not a BAD thing!

11. Selecting Many Things Rather Than Selecting One Thing From Many

12. Wonderful Garden Things was Garden things

13. one thing solved, but other terrible thing occur...

14. Bad things/Things still wrong in 10.3

15. [News] Number of Things That Free Software Teaches, Things to Consider in Selection