Re: Inform: objectloop


Wed, 22 Nov 1995 13:46:21 GMT

te_s343@kingston.ac.uk (Adrian Preston) wrote:

>Why doesn't this work?

> objectloop ( i in player ) move i to room_name;

>Only the first object in the players inventory is moved.

I think this (more or less) quote from the Designer's Manual is
relevant:

WARNING
When looping through the object tree, be careful if you are altering
it at the same time. For instance, objectloop (x in rucksack) remove
x; is likely to go horribly wrong - it's safer not to cut down a tree
while actually climbing it. The safe way is to keep lopping branches
off:

while (child(x)~=0) remove child(x);

Bruce Barnett