My widget is behaving strangely. The first time it is called from a passage with <<newTopic “Tinitial”>>
the alert reports Tinitial (with no quotation marks) and the next time it is called, the alert reports with quotation marks. This difference is causing errors in the rest of the widget logic. What is the reason it behaves differently on the second call?
It would be helpful if you post the code calling the widget in context. You say “the next time it is called”, is that in the same passage, a different passage?
Also the remaining widget logic may well be relevant, if you could post that too.
I can’t reproduce the issue with the code you gave. <<newTopic "Tinitial">> always behaves the same no matter how many times it’s called. The problem is likely in the code calling the widget.
One thing you should check is whether you’re accidentally using curly quotes. If you call the widget using curly quotes, it will cause the behavior you describe.
Thanks for that clever guess. I don’t even understand how those curly quotes got introduced to my code. I’ve been working for days trying to track down that error!
@Doug_Egan
If you ever copied the code into a word processing type application, or into a chat-bot, then its possible that that application/bot automatically converted the Standard quotes into Typographical (Curvy) ones.
And if you then copied the contents from such an application/bot back into the Twine 2.x application then those Typographical ones would of remained, because Twine doesn’t do a reversed conversion, due to Typographical characters being valid in Textual content.
This is behaviour is one reason why word processing type applications, and some of the chat-bots, are not good tools to use when it comes to editing code.