Hi Shawn,

The class idea sounds interesting, and I'll bear it in mind for future
use, but I need a true array to pass into a COM object, so I think the
class is probably out for the moment.

I have a book which has a large section for dealing with arrays in
memory via API calls, and was considering writing a COM object to do
something similar to what you suggested using C++ (my C++ skills are
completely dead nowadays), but I think what I'm going to do is write a
function to loop through and add all the data from array2 to array1 and
then see how it performs in testing. If it doesn't perform well (there
will be about 10000 values in each array) then I think I'll go down the
CopyMemory API route.

Thanks for your suggestions :)

Dan

-----Original Message-----
From: Shawn K. Hall [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2004 01:07
To: [EMAIL PROTECTED]
Subject: RE: [ASP] Concatenating Two-Dimensional Arrays


Hi Dan,
 
> I'm wondering if there's a quick way to "join" (not
> as in the join() function) two two-dimensional arrays?

You could probably do it by passing both arrays to a compiled C++
object that used a CopyMemory call to join them explicitly, then
return them via a third variable. Personally, I think this is
overkill.


> Basically I have two two-dimensional arrays from
> different sources...

Are they two different SQL sources? You could export the results via
ADO to an xml stream then join them, then reload them into memory as
a two-dimensional array.

But even that sounds rather process intensive.

Have you considered just creating a VBS Class object that 'fakes'
it? It would take multiple two-dimensional arrays as seeds, then
fake the same properties and functions as an array by automagically
determining the requested indexes and relaying them to the actual
array. It could be used to persist the values through the session or
application, too, minimizing load on the database server or wherever
the data was coming from.

There's a VBS Class generator on my site (which can help you figure
out what to do) here:
  http://ReliableAnswers.com/ASP/VBSClass.asp
I have been using this script myself the last few days to create
some really nifty dynamic-loading scripts. The things I've created
and forgotten about completely... :)

Regards,

Shawn K. Hall
http://ReliableAnswers.com/

'// ========================================================
    If I had only known, I would have been a locksmith.
        -- Albert Einstein (1879 - 1955)





---------------------------------------------------------------------

 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to