swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] Re:help for listindex!


From: HU Xiaojun
Subject: [Swarm-Support] Re:help for listindex!
Date: Wed, 19 Jan 2005 08:59:36 +0800

hi,
Can somebody give me a hand about this?
I think the answer might be very easy, but I just can't find it!
I want to replace some of the members in the list. I use the method "remove" and
"addafter" of listindex to do that, but the compiler always gives a warning
message about the line: "relationIndex = [relationList begin: [self getZone]];"
it says:"objects does not comform to the "listindex" protocol"
why,could someone help me?

Thanks

xiaojun




>Message: 2
>Date: Mon, 17 Jan 2005 10:03:06 +0800
>From: "HU Xiaojun" <address@hidden>
>Subject: [Swarm-Support] How to addafer an object?
>To: address@hidden
>Message-ID: <address@hidden>
>Content-Type: text/plain
>
>Hi,
>
>I have a question.
>I want to remove an object from a list and insert another object at the same
>postion.
>
>- a function
>{
>....
>id <Index> relationIndex;
>id element;
>id newelement=nil;
>relationIndex = [relationList begin: [self getZone]];
>for(element = [relationIndex next]; [relationIndex getLoc] == Member; element =
>[relationIndex next])
>{
>     if(....)
>         { 
>       [relationIndex remove];
>       newelement=....
>         [relationIndex addAfter: newelement];
>         }   
>       
>}
>[relationIndex drop];
>return self;
>}
>When I compile it, it complains that method "addAfter" not implemented by
>protocol.
>so I made some change,I decalre the relationIndex as:
>id <ListIndex> relationIndex;
>and keep the other things.
>when i compile it, it complains that in the line of 
>"relationIndex = [relationList begin: [self getZone]];" objects does not 
>comform
>to the "listindex" protocol.
>I don't know how to define a RETURNABLE listindex, can somebody help me? 
>The version is swarm-2.1.1.
>
>Best regards!
>
>xiaojun
>
>
>Tsinghua Univ.
>Beijing
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]