> Second problem: I have a cupboard which is mentioned in the room
> description and should print out a message only if it's actually
> open and there is something inside it. If I put this in the
> initial property, the library insists on printing a new_line
> every time the cupboard is closed. Same thing happens if I use
> the when_open property, even if I don't use when_closed at all.
> (BTW, there seems to be a slightly inconsistent behaviour of the
> initial property anyway, as it will not print out anything if if
> defined in an object with the switchable attribut set.)
I too have encountered this problem, but found a way of getting around
it. Your initial routine presumably is something like:
Initial
[; if (self has open)
"The cupboard is open";
],
This, as you say, will somtimes produce a blank line when the cupboard
is open. You can get around this by changing the code to:
Initial
[; if (self has open)
{print "The cupboard is open"; rtrue};
],
or sometimes:
Initial
[; if (self has open)
{print_ret "The cupboard is open"};
],
I have found, however, that this can be inconsistant depending on the
computer I compile the code on, for example my PC version of Inform
_will_ produce the extra line, but my Acorn version will not.
I hope this helps.
-- Paul.