Maybe I don't understand the question, but why not just like this: Do
ProcessIt(oMyMsg[0]) oMyMsgs.Remove(0) Loop Until oMyMsg.Count = 0 Jussi On Thu, Jan 19, 2012 at 15:23, Ron <r...@cyberjunky.nl> wrote: > Hi community, > > Let say I have a class called CMyMsg like this: > > ' Gambas class file > > PUBLIC Length AS Integer ' packet length > PUBLIC Prio AS Integer ' 0 = normal, 1 = system > PUBLIC Node AS Integer ' node id > PUBLIC Key AS String > PUBLIC Packet AS NEW Byte[] ' data to send > PUBLIC AwaitAck AS Boolean > > PUBLIC SUB SetLength(iLength AS Integer) > > Length = iLength > > END > > PUBLIC SUB SetPrio(iPrio AS Integer) > > Prio = iPrio > > END > > PUBLIC SUB SetNode(iNode AS Integer) > > Node = iNode > > END > > PUBLIC SUB SetKey(sKey AS String) > > Key = sKey > > END > > PUBLIC SUB SetPacket(aPack AS Byte[]) > > Packet = aPack > > END > > PUBLIC SUB SetAwaitAck(bAck AS Boolean) > > AwaitAck = bAck > > END > > And I instantiate several copies of it in my project with this: > > PRIVATE oMyMsgs AS NEW Object[] > > PUBLIC SUB CreatePacket() > > DIM MyMsg AS NEW CMyMsg > > MyMsg.SetKey(Rnd) > MyMsg.SetLength(iPacketLen + 2) > MyMsg.SetPrio(0) > MyMsg.SetAwaitAck(TRUE)) > MyMsg.SetPacket(bBuffer) > > oMyMsgs.Add(MyMsg) > > END > > Further down, I loop through these objects in oMyMsgs and do something > with them like this: > > PUBLIC SUB ParsePackets() > > DIM MyMsg AS CMyMsg > > FOR EACH MyMsg IN oMyMsgs > > ProcessIt(MyMsg) > > ' question is how to delete the MyMsg entry here and remove it from > oMyMsgs objects list? > ' or is there another way to do this efficiently? > > NEXT > > Thanks in advance! > > Regard, > Ron_2nd. > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user