I7 problem adding text items to a list [resolved]

Hi!
I have a problem adding texts in real time to a list.

Apparently the adding operation overwrites the content of the list.

Maybe I do (or assume) something wrong.

"List Problem" by Sebas


Test is a room.


The L is a list of texts which varies.
The jumper text is a text variable.
The counter is a number variable.

Instead of jumping:
	now counter is counter + 1;
	now jumper text is "[counter] times";
	add jumper text to L;
	let count be 1;
	repeat with item running through L:
		say "[count]: [item][line break]";
		increase count by 1.
		
Test me with "jump / jump / jump".

The output:

List Problem
An Interactive Fiction by Sebas
Release 1 / Serial number 150304 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

Test

jump
1: 1 times

jump
1: 2 times
2: 2 times

jump
1: 3 times
2: 3 times
3: 3 times

jump
1: 4 times
2: 4 times
3: 4 times
4: 4 times

When you make jumper text “[counter] times” in 6L02 and later versions of Inform, it’s actually treating that as a function–what it’s done is essentially to store an instruction to look up the value of “counter,” print that, and then write “times”.

The way to freeze the text as the thing that it prints at this moment is to say “the substituted form of.” So you can write:

Instead of jumping: now counter is counter + 1; now jumper text is the substituted form of "[counter] times";

and it should work. (I haven’t tested it, though.)

I screwed this up in my current ParserComp game; I wrote something like:

When play begins: repeat with astro running through astronauts: now the personal name of astro is "[one of]Liam[or]Sarah[or]Sophia[or]Ibrahim[or]Fatima[or]Yasmin[in random order] [one of]Lee[or]Chen[or]Zhang[or]Jackson[or]Nguyen[or]Kim[or]Suzuki[or]Jacque[in random order]".

[EDITED to trim the substitution because as it was it was too wide and was messing up the format of the window.]

which means, because I didn’t include “the substituted form,” that every time it tries to evaluate the name of the astronaut it picks a different random assortment of names! So this is pretty salient to me right now.

Anyway, look up “substituted form” in section 20.7 of Writing with Inform–the explanation there is probably clearer than what I gave.

Your suggestion works very well.
thank you very much!

The Inline Hyperlinks by Erik Temple apparently has that problem.

You should ping dannii about that–he’s maintaining those extensions, it seems.

There’s a fixed version here. Sorry, extensions are a bit of a mess at the moment.