I think the problem is that you need to add the newly cloned object to your list, like this:
Public Shared Function payOff(ByVal origClientList As list(of Soma_Client)) As Decimal
Dim clientList As list(of Soma_Client) = New list(of Soma_Client)
dim ii as integer
for ii = 0 to origClientList.count-1
clientList.Add(origClientList(ii).Clone)
loop
~~Bonnie
>I created a clone property in the client class which does what you say-creates a new instance, assigns values of current properties to new instance, and returns instance.
>
>This works in the simple case. For example, I create a new client instance
>from the existing values in origClient:
>
>
>Public Shared Function payOff(ByVal origClient As Soma_Client) As Decimal
>Dim Client As Soma_Client = New Soma_Client
>Client = origClient.Clone
>
>
>Very useful. However, if I try to use it in a "list of" case, I get an error.
>
>
>Public Shared Function payOff(ByVal origClientList As list(of Soma_Client)) As Decimal
>
>Dim clientList As list(of Soma_Client) = New list(of Soma_Client)
>dim ii as integer
>
>for ii = 0 to origClientList.count-1
> clientList(ii) = origClientList(ii).Clone
>loop
>
>
>In this case I get an "index out of range" error.
>
>Hoping for magic, if I separate the two indexed expressions
>and use two statements:
>
>
>dim origClientRec as soma_client = new soma_client
>for ii = 0 to origClientList.count-1
> origClientRec = origClientist(ii).clone
> clientList(ii) = origClientRec.clone
>loop
>
>
>I still get "index out of range" error, but it occurs on the
>SECOND statement. If it means anything, the error display shows the little red line underneath the 'e' in clone in the second statement.
>
>I got the same results implementing the clone feature as a function in the client class.
>
>Perhaps I'm not defining my objects properly? Perhaps it can't be done? Thanks for your thoughts.