You could use an Array story variable to store the comments the user enters.
1. Initialise the Array in your project's startup tagged special Passage using the (a:) macro.
(set: $userComments to (a:))
2. Use TwineScript like the following to obtain the comment from the user and to add it to the Array.
warning: The (prompt:) macro will return an empty String value if the user either selects the 'Cancel' option or selects the 'OK' option without entering a value into the field. You can use the (unless:) macro to make sure you are only adding actual comments to the Array.
(link-repeat: "Report a bug")[{
(set: _userComment to (prompt: "Your comment", ""))
(unless: _userComment is "")[
(set: $userComments to it + (a: _userComment))
]
}]
3. Displaying the comments (elements) contained within the Array using the (for:) macro.
warning: The (for:) macro will show an error if it is passed an empty Array, you can use an (unless:) macro to check the Array's length value to make sure it contains elements.
{
(unless: $userComments's length is 0)[
(set: $counter to 0)
(for: each _comment, ...$userComments)[
(set: $counter to it + 1)
<br>$counter: _comment
]
]
}
4. Combining the asking for a comment and the displaying of the contents of the Array in the same Passage.
The following example consists of two passages:
a. The first passage (named whatever you like) displays the "Report a bug" link and the contents of the Array.
(link-repeat: "Report a bug")[{
(set: _userComment to (prompt: "Your comment", ""))
(unless: _userComment is "")[
(set: $userComments to it + (a: _userComment))
]
(replace: ?comments)[(display: "List User Commments")]
}]
{
User Comments: ((link-repeat: "Refresh")[(replace: ?comments)[(display: "List User Commments")]])
|comments>[(display: "List User Commments")]
}
b. The second passage (named List User Commments in this example) contains the TwineScript from the above Point 3.
note: You will notice that I added a (replace:) macro within the associated hook of the the "Report a bug" link, this causes the User Comments list to be automatically updated each it a new comment is added to the Array. If you don't want that to happen then simply remove that (replace:) macro.