[Gambas-user] more than one array in a struct (gb.xml.rpc)

Ron ron at ...1740...
Mon Mar 16 14:52:37 CET 2009


Hmm... hopefully someone can kick me in the right direction on this one:

I have a struct (RpcStruct) and I want to insert multiple arrays 
(RpcArray) in it which are filled by a for each loop. (number of arrays 
is variable)

If I clear the array each time at the end of the loop with .Clear() it 
removes the array data which is already added to the sList struct, so 
thats not what I want, anyone has an idea how to cope with this?

Thanks a lot in advance.
I'm running Gambas 2.11

Regards,
Ron_2nd.

   DIM aTmpArray AS NEW RpcArray
   DIM sList AS NEW RpcStruct

   rResult = Main.hDB.Exec("SELECT * FROM devices")

   FOR EACH rResult

     aTmpArray.Add(rResult!name, XmlRpc.xString)
     aTmpArray.Add(rResult!value, XmlRpc.xString)
     aTmpArray.Add(rResult!label, XmlRpc.xString)
     sList.Add(rResult!name, aTmpArray, XmlRpc.xArray)

    ' aTmpArray.Clear()

   NEXT

   hXMLRPC.SetReply(sList)




More information about the User mailing list