Arrays are not objects and from my understanding of how variables and
arrays are constructed, you cannot assign one array to another in
order to copy the contents of the array. I believe you will need to
create a routine that copies the content of the array, one element at
a time.

If your intent is to always read Winsock data into the same named
array and transfer that to an array with a different name without
needing the data in the original array, I think that can be done. You
can use some external API functions to change an internal variable
pointer to switch the array buffer from one variable to another. I
haven't tried this myself but I think it's possible but it requires an
understanding of how variables are constructed and stored in memory.

You might also look at the EVAL and EXECUTE commands where you can
change array names at time of execution. This won't help with copying
the contents of an array, only with assigning different array names
when you do your Winsock calls.

-Tom
--- In [EMAIL PROTECTED], "elriba75" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Thanks for replying.
> 
> With objects it works this way:
> 
> 1) Assignment is a reference assignment, so that ObjB and ObjA are
> "pointing" to the same object:
> Set ObjB = ObjA
> 
> 2)  However, I can clear a reference without destroying the object (
> because ObjB is referencing the object too):
>    ObjA = ""
>    or 
>    Set ObjA = Nothing
> 
> Clears ObjA, BUT ObjB still contains (actually points to) the original
> object.
> 
> I need something like this but for Arrays for some work I'm doing.   I
> have a function that reads data using Winsock and places it into an
> array.  Instead of using that data from THAT array, I want to copy it
> to another reference, and use that.   
> 
> Function myFunc()
>    ArrayA = SPLIT(dataFromWinsock,'|')
>    .....some code
>    ok = True
> End Function
> 
> Sub Process
>    If myFunc() = True  Then
>       ArrayB = ArrayA
>       ArrayA = ""
>    End If
>    ----use ArrayB from now on....
> 
>    If myFunc() = True Then
>        ArrayC = ArrayA
>        ArrayA = "
>    End If
>    ---- Use ArrayC and ArrayB now...
> End Sub
> 
> The exact code is quite different, but the idea is the same.
> 
> Best regards,
> Edgard
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to